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
  1. You ask: "Send an email to Bob"
  2. The AI identifies your plugin tool.
  3. Cortex sees "OAuth Required" and sends an **Authorize** button.
  4. You click the link on your phone.
  5. You log in via your email provider.
  6. 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

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.