Developer Portal Integration

Last updated: 3 minutes read.

Tyk Streams seamlessly integrates with the Tyk Developer Portal, enabling developers to easily discover, subscribe to, and consume async APIs and event streams. This section covers how to publish async APIs to the developer portal, provide documentation and enable developers to subscribe to events and streams.

Important notice: Tyk Stream in Lab Release

Tyk Streams is currently in the Lab Release phase. It is under active development and testing, and is not intended for production use. For more details and to provide your feedback, please visit our Lab Release Information Page.

Publishing Async APIs to the Developer Portal

Publishing async APIs to the Tyk Developer Portal follows a similar process to publishing traditional synchronous APIs. API publishers can create API products that include async APIs and make them available to developers through the portal.

To publish an async API:

  • In the Tyk Dashboard, create a new API and define the async API endpoints and configuration.
  • Associate the async API with an API product.
  • Publish the API product to the Developer Portal.
  • Copy code

Async API Documentation

Providing clear and comprehensive documentation is crucial for developers to understand and effectively use async APIs. While Tyk Streams does not currently support the AsyncAPI specification format, it allows API publishers to include detailed documentation for each async API.

When publishing an async API to the Developer Portal, consider including the following information in the documentation:

  • Overview and purpose of the async API
  • Supported protocols and endpoints (e.g., WebSocket, Webhook)
  • Event types and payloads
  • Subscription and connection details
  • Example code snippets for consuming the async API
  • Error handling and troubleshooting guidelines

Enabling Developers to Subscribe to Events and Streams

Tyk Streams provides a seamless way for developers to subscribe to events and streams directly from the Developer Portal. API publishers can enable webhook subscriptions for specific API products, allowing developers to receive real-time updates and notifications. To enable webhook subscriptions for an API product:

  1. In the Tyk Developer Portal, navigate to the API product settings.
  2. Enable the “Webhooks” option and specify the available events for subscription.
  3. Save the API product settings.

Enable Portal Webhooks

Once webhook subscriptions are enabled, developers can subscribe to events and streams by following these steps:

  • In the Developer Portal, navigate to the My Apps page.
  • Select the desired app.
  • In the “Webhooks” section, click on “Subscribe”.
  • Provide the necessary details:
    • Webhook URL: The URL where the event notifications will be sent.
    • HMAC Secret: Provide a secret key used to sign the webhook messages for authentication.
    • Events: Select the specific events to subscribe to.
  • Save the subscription settings.
  • Copy code

subscribe to webhooks from portal

To configure the async API stream for webhook subscriptions, use the following output configuration in your API definition:

  - portal_webhook:
      event_type: bar
      portal_url: http://localhost:3001
      secret: <portal-api-secret>

Replace with the actual secret key used for signing the webhook messages.

By enabling webhook subscriptions, developers can easily integrate real-time updates and notifications from async APIs into their applications, enhancing the overall developer experience and facilitating seamless communication between systems.

With Tyk Streams and the Developer Portal integration, API publishers can effectively manage and expose async APIs, while developers can discover, subscribe to, and consume event streams effortlessly, enabling powerful real-time functionality in their applications.