Back to blog

Published on·By the DonoLink team·5 min read

Build an IRL streaming activity feed with the DonoLink API

Read donations and historical events in your personal IRL streaming app. Learn how polling, cursors and checkpoints help after network interruptions.

#api#developers#irl#activity feed#integrations

An IRL stream needs a different interface from a desk setup. You want to quickly see who donated, read the message and catch up on activity you missed. A personal app can display precisely what matters to you. The DonoLink activity feed API supplies stored events; your app controls presentation and processing.

A current feed needs more than a refresh button

Fetching only the latest ten events each time can skip activity during a busy stream or a long network interruption. A continuous integration should walk forward from a known position. Use ascending order with order=asc and keep the cursor returned by the API.

Choose a fixed since boundary when you start the integration. It filters the time DonoLink stored the event, rather than the original date of an imported donation. Do not keep changing that boundary to “now” while polling: changing filters invalidates the existing cursor.

The reading loop for your IRL app

  1. Request up to 100 events with your personal API key, order=asc and fixed filters.
  2. Process each event using its unique ID. If that ID was already processed, do not repeat its action.
  3. Save pagination.next_cursor only after every event on the page has been processed successfully.
  4. If has_more is true, immediately read the next page. Otherwise, wait about five seconds.
  5. Persist the filters and cursor in your own storage so the app can resume after a restart.

The documentation includes a Node.js example implementing this loop. You supply the functions that process events and store the checkpoint. An empty page means no new stored events currently match the query. When a cursor already exists, the API returns it unchanged so you can keep checking from that position.

Recovering from poor coverage

A network error is not a reason to erase the cursor. Show a temporary connection status, wait and retry the same request. For HTTP 429 or 503, DonoLink returns Retry-After: 60. Respect that delay. An expired or revoked key returns 401; it needs replacement rather than an endless retry loop.

This feed is not a guaranteed exactly-once event bus. A donation can later be refunded or disputed, and stored records can disappear. Make processing safe to repeat. For recovery, you can reread an overlapping period and skip known event IDs. Do not use the activity feed to trigger automatic payments or other irreversible actions.

Select the information that matters outdoors

Use type=donation to limit the feed to donations. Add platform=donolink to select DonoLink donations; imported donations have their own source. Leave filters out if you also want stored follows, subscriptions, gifted subscriptions, cheers and raids. The event reference describes each field and unit.

Keep the mobile interface readable: perhaps the display name, message and value of the most recent event. Format monetary values using currency and cents; display TikTok diamonds as diamonds. Names and messages come from third parties, so render them as text. A message must never become HTML or executable code in your app.

Keep the API key out of your stream

Enter your personal key into your native app and store it in Keychain or Android Keystore. Never embed one shared key in an app distributed to other people. If you build for multiple streamers, each account needs isolated secrets and data. API v1 does not yet have an OAuth flow for users to authorize your application.

Start with the DonoLink Developer API introduction, then create your key in Settings → Developer. If you mainly need a donation link, create a free account and set up your donation page first. You do not need to build an app to accept support from viewers.

Frequently asked questions

Can I display DonoLink donations in my own IRL app?

Yes. A personal API key lets you read stored activity and display donations or other stream events in your own app. You build the interface and storage yourself.

Does the DonoLink API have a WebSocket?

API v1 uses HTTP polling. There is no public WebSocket or webhook endpoint. The documentation example polls about every five seconds and reads additional pages immediately when has_more is true.

How do I recover events after a connection interruption?

Use order=asc with a fixed since boundary. Save next_cursor after successful processing and resume with it after the interruption. Process events idempotently by ID and respect request limits.