advocate-cli
v0.4.0
Published
CLI tool for managing your Advocate widget configuration.
Readme
@advocate/cli
Command-line tool for setting up and managing your Advocate widget configuration.
Usage
npx @advocate/cli init # interactive setup wizard
npx @advocate/cli status # check API connection
npx @advocate/cli config # print current configadvocate init
Walks you through setup. You will need your secret key (sk_...) from
dashboard.advocatewidget.com → API Keys.
The secret key is never saved — only the paired publishable key is written to disk.
$ npx @advocate/cli init
Advocate Widget — Setup
Get your secret key from dashboard.advocatewidget.com → API Keys
? Secret key (sk_...): ****************
✓ Connected to Acme CRM
? Widget position: › Bottom right
? Delay before showing (ms): 3000
✓ Config written to .advocaterc.json (permissions: 0600)
✓ Added .advocaterc.json to .gitignore
Your publishable key — add this to your app:
import { init } from 'advocate-widget';
init({
siteKey: 'pk_live_xxxxx',
position: 'bottom-right',
delay: 3000,
});
Your secret key has not been saved anywhere.
To re-run setup, return to dashboard.advocatewidget.com to retrieve it.advocate status
$ npx @advocate/cli status
✓ Connected to Acme CRM
Key: pk_live_xxxx...
Config: /path/to/.advocaterc.jsonadvocate config
$ npx @advocate/cli config
Config: /path/to/.advocaterc.json
siteKey: pk_live_xxxx...
position: bottom-right
delay: 3000ms