Get started
The three keys explained
WaForge has three kinds of credentials. They are not interchangeable: each one works in one direction, for one job. If you only read one page of these docs, read this one.
Secret API key
Job: your server asks WaForge to send and check OTP codes.
Lives: on your server only (an environment variable).
Create: Dashboard, API keys, New secret key.
Widget key
Job: the OTP widget in a visitor's browser sends and checks codes.
Lives: in your web page, locked to the domains you list.
Create: Dashboard, API keys, New widget key.
Data feed secret
Job: WaForge signs its requests to your website, so the AI agent can read live prices and stock and your site knows the request is really from WaForge.
Lives: in your website's server config.
Create: Dashboard, Data feeds, Your website.
Which key do I need? #
| I want to... | Key | Who calls whom | Guide |
|---|---|---|---|
| Verify phone numbers from my backend (sign-up, login, checkout) | Secret API key wf_sk_ | Your server calls WaForge | OTP API guide |
| Add a phone check to a web page without writing backend code | Widget key wf_pk_ + allowed domains | The visitor's browser calls WaForge | OTP widget |
| Let the AI agent quote my real prices, stock and order status | Data feed secret wf_fs_ | WaForge calls your website | Connect your website |
| Tell WaForge that stock or a price just changed | The same data feed secret | Your server calls WaForge | Change events |
| Give the agent my prices from a spreadsheet | No key | WaForge reads your published sheet | Google Sheets and CSV |
| Put a "Chat on WhatsApp" button on my site | No key | The visitor opens WhatsApp | WhatsApp button |
Example: a shop like BCard. To let the WhatsApp agent answer "how much is the black card?" with the live price from the shop's database, the shop needs only the data feed secret: install a kit on the website, paste the secret, run the feed checker. The API key and the widget key are only needed if the shop also wants to verify customers' phone numbers with OTP codes.
Secret API key in detail #
- Format
wf_sk_followed by 40 hex characters. Shown once when you create it; WaForge only keeps a SHA-256 hash, so a lost key cannot be shown again: create a new one. - Send it as a bearer token:
Authorization: Bearer wf_sk_...tohttps://waforge.online/api/v1/.... - It works from any IP and any origin. That is why it must never appear in JavaScript, a mobile app, a public repository or a URL.
- Revoke it in Dashboard, API keys. Revocation is immediate: the next call answers
401 invalid_api_key.
Widget key in detail #
- Format
wf_pk_followed by 40 hex characters. It calls the same OTP endpoints as a secret key, but only from your allowed domains. - Allowed domains are exact host names, separated by commas when you create the key:
shop.example.com, example.com.www.example.comis a different host and must be listed too. Subdomains are not included automatically. A widget key with no domains refuses every request. - WaForge reads the host from the browser's
Originheader (orRefererwhen there is no Origin) and answers403 origin_not_allowedwhen it is not on the list.
A widget key is public, not secret. The domain check stops other websites from using your key in a browser. A script outside a browser can still fake the Origin header, so the real protection is your plan's per-minute and monthly limits. Watch Dashboard, OTP logs, and revoke and replace the key if you see sends you did not expect.
Data feed secret in detail #
When you add your website in Dashboard, Data feeds, WaForge shows four values once. Copy all four into your site's config:
| Value | Example | What it is |
|---|---|---|
| Feed secret | wf_fs_3q2Kx... (43 characters after the prefix) | The HMAC key. Secret. Stored encrypted by WaForge, never shown to the AI. |
| Key id | fs_k3j9x0aq1m2b7c | Names which secret signed a request (kid in the signature header). Not secret. |
| Tenant id | wf_tn_Xc81... | Your public account id, sent as WaForge-Tenant. Not secret. |
| Verification token | wfv_9f2c... | Proves you own the domain (manifest, DNS TXT or meta tag). Not secret. |
- Direction 1, WaForge to you: every request to your feed carries
WaForge-Signature, an HMAC-SHA256 made with this secret. Your site recomputes it and refuses anything that does not match. See Request signing. - Direction 2, you to WaForge: you sign change events with the same secret.
- Rotation: Dashboard, your feed, New secret. WaForge signs with the new secret immediately, so update your site right away (live lookups fail and the agent hands chats to you until you do). Events you send are accepted with either of your two most recent secrets.
Common mistakes #
- Putting a
wf_sk_secret key in a web page. Use a widget key there, or call WaForge from your server. - Sending the feed secret to WaForge in a header. It is never sent: only the signature made with it is.
- Using an API key to connect a data feed. API keys only work for the OTP endpoints.