What is appSecret?
The appSecret is your app’s private decryption key. It’s used to decrypt events that are sent to your app. You receive it when you create an app.Usage
Pass the appSecret when creating your EnSync client:- Node.js
- Python
How It Works
Encryption Flow
- Publisher encrypts: Event is encrypted with your appId
- EnSync delivers: Encrypted event is sent to your app
- Your app decrypts: SDK uses appSecret to decrypt the event
Single Recipient (Asymmetric)
Multiple Recipients (Hybrid)
Security
Best Practices
- Never commit to version control: Use environment variables or secret managers
- Never log or print: Avoid exposing in logs or error messages
- Rotate carefully: Changing appSecret requires coordination with publishers
- Store securely: Use secret management services (AWS Secrets Manager, HashiCorp Vault, etc.)
appId vs appSecret
Your app has both a public and private key:- appId (public key): Share with publishers so they can encrypt events for your app (safe to expose)
- appSecret (private key): Keep secret (never share)
Rotating appSecret
To rotate your appSecret:- Create a new app with the same permissions (see Create Access Key)
- Update your app to use the new appKey and appSecret
- Notify publishers of your new appId
- Update service key pair if needed (see Update Service Key Pair)
- Deprecate the old key after transition period