WorkflowTESTING & DEBUGGING
End-to-End Testing
How to verify your plugin's logic and the complete OAuth handshake using Sandbox mode.
1Local Environment
To test locally, your server must be reachable by the Cortex Cloud. We recommend using localtunnel or ngrok.
- Run your plugin on a port (e.g., 3000)
- Create a tunnel to expose it
bash
# Run your plugin node index.js # In a new terminal, expose port 3000 npx localtunnel --port 3000
2Sandbox Installation
Head to Dashboard > Developers > Plugins.
Publish
Enter your tunnel URL + /manifest
Install
Select the plugin and click Install Sandbox
Configure
Click Configure OAuth to set your Client ID/Secret
3Trigger the Auth Flow
Now, open WhatsApp and send a message to your bot that triggers a tool from your plugin.
The Sequence
- You ask: "Send an email to Bob"
- The AI identifies your plugin tool.
- Cortex sees "OAuth Required" and sends an **Authorize** button.
- You click the link on your phone.
- You log in via your email provider.
- Cortex stores the token and calls your tool!
Watch your Server Logs
[POST] /execute
> Incoming Context: { "userAccessToken": "ya29.a0Ad5..." }
> Tool: send_email
> Status: 200 OK
> Incoming Context: { "userAccessToken": "ya29.a0Ad5..." }
> Tool: send_email
> Status: 200 OK
Secret Management
In Sandbox mode, secrets last 5 minutes. If yours expires, simply click **Rotate Secret** in the dashboard.
Force Auth
Respond with a 401 Unauthorized from your server if you want to force the user to re-authenticate manually.