Skip to content

Commit

Permalink
document webhook validation (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeke authored May 13, 2024
1 parent ad15517 commit 1dd11e2
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,22 @@ if err != nil {
fmt.Println("output: ", prediction.Output)
```

### Webhooks

To prevent unauthorized requests, Replicate signs every webhook and its metadata with a unique key for each user or organization. You can use this signature to verify the webhook indeed comes from Replicate before you process it.

This client includes a `ValidateWebhookRequest` convenience function that you can use to validate webhooks:

```go
import (
"github.com/replicate/replicate-go"
)

isValid, err := replicate.ValidateWebhookRequest(req, secret)
```

To learn more, see the [webhooks guide](https://replicate.com/docs/webhooks).

## License

Replicate's Go client is released under the Apache 2.0 license.
Expand Down

0 comments on commit 1dd11e2

Please sign in to comment.