> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ensync.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# App ID

> Understanding appId identifiers

## What is appId?

The **appId** is a public identifier for your app in the EnSync network. It's used by publishers to specify which apps should receive their events and is also your app's public key used for encryption.

## Usage

### As a Publisher

Specify recipient appIds when publishing events:

```javascript theme={null}
await client.publish(
  "order/created",
  ["partner-app-id-1", "partner-app-id-2"],  // Recipient appIds
  { orderId: "123", amount: 99.99 }
);
```

### As a Subscriber

Your appId is automatically included in received events:

```javascript theme={null}
subscription.on(async (event) => {
  console.log("Sender:", event.sender);  // Sender's appId
  await event.ack();
});
```

## Getting Your appId

You receive your appId when creating an app in the EnSync Dashboard or via the API.

You receive:

* appKey (for authentication)
* appId (public identifier)
* appSecret (for decryption)

See [Create Access Key](/api-reference/endpoint/access-keys/create) for details.

## Sharing Your appId

Your appId is **public** and safe to share. Publishers need your appId to send events to your app.

### What to Share

✅ **Share with publishers:**

* Your appId (public key)
* Event paths you want to receive

❌ **Never share:**

* Your appKey (authentication credential)
* Your appSecret (private decryption key)

## Finding Partner appIds

To publish events to a partner, you need their appId. You receive partner appIds through:

1. **Webhook**: EnSync sends the partner's appId via webhook when they connect using your developer portal
2. **Documentation**: Listed in integration guides
3. **Direct communication**: Exchanged via email or support
4. **EnSync Dashboard**: View connected partners and their appIds

## Event Routing

EnSync uses appIds to route events:

```javascript theme={null}
// Publisher (your appId: "app-123")
await client.publish(
  "order/created",
  ["partner-app-456", "partner-app-789"],  // Target appIds
  orderData
);

// EnSync creates separate queues:
// - Queue for partner-app-456
// - Queue for partner-app-789

// Each partner receives the event independently
```

## Multiple Apps

You can create multiple apps for different purposes:

```
production-app-id     → Production environment
staging-app-id        → Staging environment
development-app-id    → Development environment
```

Each app has its own:

* appId (public identifier)
* appKey (authentication)
* appSecret (decryption)
* Permissions (send/receive)
* Event queues

<Note>
  Use different apps per environment to isolate event flows and prevent cross-environment issues.
</Note>
