docs: explain API key provisioning

This commit is contained in:
Mo Elzubeir
2026-05-29 14:47:41 -05:00
parent 57b1a67c2e
commit b33fd01182
4 changed files with 44 additions and 0 deletions
+24
View File
@@ -28,6 +28,30 @@ Use `@socialhose/api` from server-side JavaScript/TypeScript to build:
This package is intended for **backend code only**. Do not ship your Socialhose API key to browsers.
## Getting an API key
API keys are issued by Socialhose. The SDK does not create keys, and there is no self-service key-generation flow documented in this package.
To use the SDK:
1. Request Socialhose Public API access from the Socialhose team or your account administrator.
2. Ask for an API key with access to the campaigns you need to query.
3. Store it as a server-side environment variable:
```bash
export SOCIALHOSE_API_KEY="sh_your_key_here"
```
4. Pass it to the client:
```ts
const socialhose = new SocialhoseClient({
apiKey: process.env.SOCIALHOSE_API_KEY!,
});
```
Do not commit API keys, expose them in frontend bundles, or send them to browsers. If you are building a web app, call Socialhose from your server/API route and return only the data your frontend needs.
## Install
```bash