Use this file to discover all available pages before exploring further.
Fonoster uses a Workspace-centric approach, meaning all operations are performed against a specific Workspace. By default, when you self-host Fonoster, it automatically creates a default Workspace along with a default username and password.
Once the installation is complete, create a new file called index.js and add the following code:
const SDK = require("@fonoster/sdk");// Replace these with your valuesconst client = new SDK.Client({ accessKeyId: "WO00000000000000000000000000000000", endpoint: "localhost:8449", allowInsecure: true});// Use your actual username and password hereclient.login("admin@fonoster.local", "changeme").then(async () => { const apikeys = new SDK.ApiKeys(client); apikeys.createApiKey({ role: "WORKSPACE_ADMIN", }).then((result) => { console.log(result); });});
4
Run the script
Finally, run the script.
node index.js
If everything goes well, you should see the new API key printed to the console, and you can use it to log in to your Workspace.