Added write your own SDK guide

This commit is contained in:
2026-09-02 02:22:21 -03:00
parent 0a7513d986
commit 8baf893a9e
10 changed files with 647 additions and 155 deletions
+5 -12
View File
@@ -45,7 +45,7 @@ Follow these steps depending on your application:
Then import it in your code:
```ts twoslash
```ts
import duckity from "@duckity/js";
```
@@ -75,7 +75,7 @@ Follow these steps depending on your application:
Once you have the SDK installed, you can request a challenge whenever you need it using
`duckity.solve()`.
```ts twoslash
```ts
const PROTECTION_PROFILE_ID: string = "";
// ---cut---
import duckity from "@duckity/js";
@@ -100,19 +100,12 @@ settings), issue the challenge as soon as possible. Note, however, that the chal
To pass threat correlation keys when issuing a challenge, set them in the `options` argument of
`duckity.solve()`.
```ts twoslash
```ts
const PROTECTION_PROFILE_ID: string = "py83YHkXV6ZpIsJZGVxzS";
// ---cut---
import duckity from "@duckity/js";
let solution = await duckity.solve(
PROTECTION_PROFILE_ID,
{
keys: {
email: "[email protected]",
}
}
);
let solution = await duckity.solve(PROTECTION_PROFILE_ID);
```
### Using On Self-Hosted Ducklings
@@ -120,7 +113,7 @@ let solution = await duckity.solve(
Self-hosted ducklings are hosted at a different domain from Duckity-hosted ducklings. To point it
to a custom domain, change the following setting:
```ts twoslash
```ts
const PROTECTION_PROFILE_ID: string = "py83YHkXV6ZpIsJZGVxzS";
// ---cut---
import duckity from "@duckity/js";