Skip to content

Commit

Permalink
feat(webhooks,format): add webhooks and multi return format
Browse files Browse the repository at this point in the history
  • Loading branch information
j-mendez committed Oct 9, 2024
1 parent 1a79f13 commit 061861d
Show file tree
Hide file tree
Showing 21 changed files with 548 additions and 911 deletions.
463 changes: 195 additions & 268 deletions cli/Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "spider-cloud-cli"
version = "0.1.3"
version = "0.1.4"
edition = "2021"
authors = [ "j-mendez <[email protected]>"]
description = "The Spider Cloud CLI for web crawling and scraping"
Expand Down
18 changes: 0 additions & 18 deletions javascript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,24 +148,6 @@ spider
- **`deleteData(table, params)`**: Delete records from the DB.
- **`createSignedUrl(domain, params)`**: Download the records from the DB.

## Supabase

You can use [Supabase](https://supabase.com/docs/reference/javascript) to directly connect to instances and write your own logic. First, you need to install `@supabase/supabase-js` since this package does not include the dependency by default. This keeps the bundle size small and allows for lazy imports of the client.

```ts
const spiderClient = new Spider({ apiKey: process.env.SPIDER_API_KEY });

// first init the supabase client to get the anon_key from the server.
await spiderClient.init_supabase();

const auth = await spiderClient.supabase?.auth.signInWithPassword({
email: process.env.SPIDER_EMAIL || "",
password: process.env.SPIDER_PASSWORD || "",
});

// now you can do anything with spiderClient.supabase
```

## Error Handling

The SDK provides robust error handling and will throw exceptions when it encounters critical issues. Always use `.catch()` on promises to handle these errors gracefully.
Expand Down
12 changes: 0 additions & 12 deletions javascript/__tests__/spiderwebai.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,16 +178,4 @@ describe("Spider JS SDK", () => {
assert(typeof signedUrl === 'string');
assert(typeof fileName === 'string');
});

test("should connect with supabase", async () => {
const spiderClient = new Spider();
await spiderClient.init_supabase();

const auth = await spiderClient.supabase?.auth.signInWithPassword({
email: process.env.SPIDER_EMAIL || "",
password: process.env.SPIDER_PASSWORD || "",
});

assert(auth);
});
});
Loading

0 comments on commit 061861d

Please sign in to comment.