How can I inject an event with tags over the EventService API


I am looking for a solution to publish an event into the event-stream with Tags over http-post. In your DOCS you describe how to publish an event, but only regarding Pondv1, without for example Tags. I need to know how to do it after the schema of Pondv2. The most important aspect is the implementation of tags. How can I achieve something like this over http-post?


Thank you for taking your time!

Hi @LennartBusekrus, have you seen Does this help?

Or are you looking specifically for how Tags are represented in the payload?

Hi @wwerner thank you for your answer. Unfortunately your second assumption is most fitting. I need to find a way to publish events with Tags oder the EventService API, so yes I would need to know how to represent Tags in the payload

Unfortunately, setting Tags via the event service http API is currently not possible. The only way to set Tags is via the Pond. Is it possible for you to use the Pond?

Currently, tags are are set via web sockets and not included in the payload.

Hm that is sad to hear. Unfortunately no, I need to emit events from inside golang-code, so the only solution would be over http. Maybe I will send them to a docker-application, which will emit them to the pond, as a work-around

Nevertheless thank you for clarifying!

1 Like

This is something that might change in the next version, though I can’t say for sure as of now. But if it does, I’ll make sure to let you know!

1 Like

try this very simple app, that translates an HTTP request into a pond.emit().

Checkout this example:

import { Pond, SplashState, ConnectivityStatus, Tags } from '@actyx/pond'
import * as bodyParser from 'body-parser'
import * as cors from 'cors'
import * as express from 'express'

export type Params = { tags: string; payload: string }
export type Emit = { eventType: string }

const bodyLimit = '20mb'

Pond.default().then((pond) => {'creating Pond - Api - Server')

  let swarmSyncState: SplashState | undefined = undefined
  let syncDone = false
  let nodeConnectivityState: ConnectivityStatus | undefined = undefined
    enabled: true,
    onProgress: (s) => (swarmSyncState = s),
    onSyncComplete: () => (syncDone = true),
  pond.getNodeConnectivity({ callback: (state) => (nodeConnectivityState = state) })

  const app = express()
  app.use(bodyParser.urlencoded({ extended: false, limit: bodyLimit }))
  app.use(bodyParser.json({ limit: bodyLimit }))
  app.get('/', (_req, res) => res.send(
  app.get('/system/pondState', (_req, res) => {
    pond.getPondState((state) => {
  app.get('/system/sync', (_req, res) => {
  app.get('/system/connectivity', (_req, res) => {

  // there are no type definitions for express-ws'/emit', async (req, res) => {
    const { tags, payload } = req.body

    if (!Array.isArray(tags) || tags.length === 0) {
      res.send({ message: `tags are invalid ${tags}` })
    //echo '{"tags": ["a", "b", "c"], "payload": "a"}' | curl -X "POST" -d @- -H "Content-Type: application/json"  localhost:4242/emit
    if (payload === undefined) {
      res.send({ message: `payload is missing` })
    const axTag = Tags(...tags)

    try {
      await pond.emit(axTag, payload).toPromise()
    } catch (e) {


    "@actyx/pond": "^1.1.0",
    "body-parser": "^1.19.0",
    "cors": "^2.8.5",
    "express": "^4.17.1",

Please let me know if this helps.

1 Like

Thanks a lot!

Hi, @LennartBusekrus

Finally, arrived.
Check it out and let us know what you think.

1 Like

Thank you so much, exactly what I needed :slight_smile: !