Skip to main content
A user finds your app in the Apps library, reviews the permissions it requests, and confirms the install. After that, Blnk Cloud sends an event to your app so you can provision the installation on your side. Here’s what happens during installation:
  1. The user clicks Install from the app details page.
  2. The user reviews and approves the permissions.
  3. Blnk Cloud creates a scoped API key for the installation.
  4. Blnk Cloud sends the install event to your backend via the callback URL.
  5. Your app stores the install details and returns a 2xx response.
  6. If the response succeeds, the app becomes active in Cloud.
See Best practices for how to protect API keys, handle duplicate events safely, and prepare for production.

Handling the install event

An install event tells your app that a user has connected it to a specific workspace and Cloud instance. The install is already scoped to that context in Blnk”you do not receive a separate organization field in the callback. Blnk Cloud sends a payload like this:
install_payload.json
Once you receive the install event, you need to save the install details so your backend can use them later.
Note: If your app does not return a 2xx response within 10 seconds, Blnk cancels the installation, revokes the API key, and the install fails.
For our Stripe Sync app, our install handler looks like this:
routes.ts
Use whatever encryption or key-management approach fits your stack before you write the secret to your database.

Handling the uninstall event

When a user uninstalls your app, Blnk Cloud sends an uninstall event to the same callback URL. If your app returns 2xx, Cloud marks the install uninstalled and revokes the app’s API key. If the callback fails, the uninstall does not complete and the API key remains valid. Your app should use this event to stop treating the installation as active. You can also clean up any resources you created for that organization or instance.
uninstall_payload.json
For the Stripe Sync app, uninstalling should mark the installation as inactive so the backend stops using the stored install record.
routes.ts
You can also choose to delete encrypted keys, remove portal sessions, or clean up instance-specific resources.

Handling duplicate events

Cloud sends one install or uninstall request per event, with a 10 second timeout. Your handler should still be safe to run more than once. Use the idempotency_key to check whether you have already processed the event. If you have already processed the event, return a 200 response to avoid processing the event again:
routes.ts

Test the installation flow

Before moving to app development, test the install and uninstall flow from Cloud.
  1. Register your app.
  2. Install the app from the Apps library.
  3. Confirm your callback URL receives the install event.
  4. Confirm your callback URL returns a 2xx response.
  5. Confirm the install is active in your database.
  6. Uninstall the app from Cloud.
  7. Confirm your callback URL receives the uninstall event.
  8. Confirm the install is no longer active in your database.

Run the example Stripe Sync app

Reference Stripe sync implementation.