Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(client): webhook url support on queue submit #26

Merged
merged 1 commit into from
Nov 10, 2023

Conversation

drochetti
Copy link
Collaborator

Notes

This PR adds support to specify a webhookUrl to the fal.queue.submit API. It also adds the WebhookResponse<Payload> type so server-side implementations can cast the parsed response to the appropriate type.

const { request_id } = await fal.queue.submit('model-id', {
  webhookUrl: 'https://url.to/my/server/webook/handler'
});

On TypeScript codebases, the WebhookResponse type can help when webhook payloads are received:

import { WebhookResponse } from '@fal-ai/serverless-client';

// on your server you can (or something along those lines)
const result: WebhookResponse = await response.json();

if (result.status === 'OK') {
  // result.error is not available
}

@drochetti drochetti merged commit 7f2bb5e into main Nov 10, 2023
1 check passed
@drochetti drochetti deleted the feature/webhook-url-support branch October 1, 2024 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants