mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-05-18 14:48:12 +00:00
fix(docs): delete connections sdk snippet (#629)
This commit is contained in:
parent
d095bd234e
commit
ea9fa65169
2 changed files with 32 additions and 8 deletions
|
|
@ -410,14 +410,27 @@ When you update the repository configuration:
|
|||
<Tab title="TypeScript">
|
||||
```typescript
|
||||
// Delete by connection ID
|
||||
const result = await client.connections.delete(connectionId);
|
||||
const result = await client.connections.deleteByID(connectionId);
|
||||
|
||||
// Or delete by provider (requires container tags)
|
||||
const result = await client.connections.deleteByProvider('github', {
|
||||
containerTags: ['user-123']
|
||||
});
|
||||
|
||||
console.log('Deleted connection:', result.id);
|
||||
```
|
||||
</Tab>
|
||||
<Tab title="Python">
|
||||
```python
|
||||
# Delete by connection ID
|
||||
result = client.connections.delete(connection_id)
|
||||
result = client.connections.delete_by_id(connection_id)
|
||||
|
||||
# Or delete by provider (requires container tags)
|
||||
result = client.connections.delete_by_provider(
|
||||
provider='github',
|
||||
container_tags=['user-123']
|
||||
)
|
||||
|
||||
print(f'Deleted connection: {result.id}')
|
||||
```
|
||||
</Tab>
|
||||
|
|
|
|||
|
|
@ -288,11 +288,16 @@ const client = new Supermemory({
|
|||
apiKey: process.env.SUPERMEMORY_API_KEY!
|
||||
});
|
||||
|
||||
// Delete by connection ID using SDK
|
||||
const result = await client.connections.delete(connectionId);
|
||||
// Delete by connection ID
|
||||
const result = await client.connections.deleteByID(connectionId);
|
||||
|
||||
// Or delete by provider (requires container tags)
|
||||
const result = await client.connections.deleteByProvider('notion', {
|
||||
containerTags: ['user-123']
|
||||
});
|
||||
|
||||
console.log('Deleted:', result.id, result.provider);
|
||||
// Output: Deleted: conn_abc123 notion
|
||||
|
||||
```
|
||||
|
||||
```python Python
|
||||
|
|
@ -301,11 +306,17 @@ import os
|
|||
|
||||
client = Supermemory(api_key=os.environ.get("SUPERMEMORY_API_KEY"))
|
||||
|
||||
# Delete by connection ID using SDK
|
||||
result = client.connections.delete(connection_id)
|
||||
# Delete by connection ID
|
||||
result = client.connections.delete_by_id(connection_id)
|
||||
|
||||
# Or delete by provider (requires container tags)
|
||||
result = client.connections.delete_by_provider(
|
||||
provider='notion',
|
||||
container_tags=['user-123']
|
||||
)
|
||||
|
||||
print(f"Deleted: {result.id} {result.provider}")
|
||||
# Output: Deleted: conn_abc123 notion
|
||||
|
||||
```
|
||||
|
||||
```bash cURL
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue