Webhooks
Accessing Webhook Configuration
- Log into your Native Frame dashboard
- Navigate to "Projects" in the left sidebar
- Select your project
- Click "Event Webhooks" in the project menu
Creating a New Webhook
- On the Event Webhooks page, you'll see a list of available event types
- Locate the "program-states" event, which is used for changes to stream states
- Click "Create Webhook" next to this event
Configuring the Webhook
On the webhook creation page, you'll configure the following:
Details
- Event Name: This will be pre-filled as "program-states"
- Max Attempts: Set the maximum number of retry attempts if the initial webhook call fails. For critical auth checks, set this to at least 3.
Request
- URL: Enter the full URL of your authentication endpoint. This should be a secure (HTTPS) endpoint on your server that will receive the webhook payload and make auth decisions.
- Method: the HTTP method for the webhook call. POST is required.
- Headers: Add any custom headers your endpoint requires. Common headers include Authorization for API keys.
Response Validation
- Headers: If your endpoint returns specific headers to validate, enter them here.
- Timeout: Set the maximum time (in seconds) to wait for a response from your endpoint. Balance this between reliability and user experience - 5 seconds is often a good starting point.
Best Practices
- Implement proper security measures on your webhook endpoint, such as API key validation.
- Keep your authentication logic fast to minimize stream startup delays.
- Log all webhook requests and responses for troubleshooting.
- Implement idempotency to handle potential duplicate webhook calls.
- Use HTTPS for your webhook URL to ensure data security.
Testing Your Webhook
After creating the webhook:
- Return to the "Manage Streams" page
- Create a new stream or select an existing one
- Attempt to start the stream
- Monitor your webhook endpoint for incoming requests
- Check the Native Frame logs for any webhook-related issues
By following these steps, you'll have set up webhook-based events for your Native Frame streams. This allows for dynamic, real-time control over who can broadcast on your platform.