chub-dev 0.1.0 → 0.1.2-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -0
- package/bin/chub-mcp +2 -0
- package/dist/airtable/docs/database/javascript/DOC.md +1437 -0
- package/dist/airtable/docs/database/python/DOC.md +1735 -0
- package/dist/amplitude/docs/analytics/javascript/DOC.md +1282 -0
- package/dist/amplitude/docs/analytics/python/DOC.md +1199 -0
- package/dist/anthropic/docs/claude-api/javascript/DOC.md +503 -0
- package/dist/anthropic/docs/claude-api/python/DOC.md +389 -0
- package/dist/asana/docs/tasks/DOC.md +1396 -0
- package/dist/assemblyai/docs/transcription/DOC.md +1043 -0
- package/dist/atlassian/docs/confluence/javascript/DOC.md +1347 -0
- package/dist/atlassian/docs/confluence/python/DOC.md +1604 -0
- package/dist/auth0/docs/identity/javascript/DOC.md +968 -0
- package/dist/auth0/docs/identity/python/DOC.md +1199 -0
- package/dist/aws/docs/s3/javascript/DOC.md +1773 -0
- package/dist/aws/docs/s3/python/DOC.md +1807 -0
- package/dist/binance/docs/trading/javascript/DOC.md +1315 -0
- package/dist/binance/docs/trading/python/DOC.md +1454 -0
- package/dist/braintree/docs/gateway/javascript/DOC.md +1278 -0
- package/dist/braintree/docs/gateway/python/DOC.md +1179 -0
- package/dist/chromadb/docs/embeddings-db/javascript/DOC.md +1263 -0
- package/dist/chromadb/docs/embeddings-db/python/DOC.md +1707 -0
- package/dist/clerk/docs/auth/javascript/DOC.md +1220 -0
- package/dist/clerk/docs/auth/python/DOC.md +274 -0
- package/dist/cloudflare/docs/workers/javascript/DOC.md +918 -0
- package/dist/cloudflare/docs/workers/python/DOC.md +994 -0
- package/dist/cockroachdb/docs/distributed-db/DOC.md +1500 -0
- package/dist/cohere/docs/llm/DOC.md +1335 -0
- package/dist/datadog/docs/monitoring/javascript/DOC.md +1740 -0
- package/dist/datadog/docs/monitoring/python/DOC.md +1815 -0
- package/dist/deepgram/docs/speech/javascript/DOC.md +885 -0
- package/dist/deepgram/docs/speech/python/DOC.md +685 -0
- package/dist/deepl/docs/translation/javascript/DOC.md +887 -0
- package/dist/deepl/docs/translation/python/DOC.md +944 -0
- package/dist/deepseek/docs/llm/DOC.md +1220 -0
- package/dist/directus/docs/headless-cms/javascript/DOC.md +1128 -0
- package/dist/directus/docs/headless-cms/python/DOC.md +1276 -0
- package/dist/discord/docs/bot/javascript/DOC.md +1090 -0
- package/dist/discord/docs/bot/python/DOC.md +1130 -0
- package/dist/elasticsearch/docs/search/DOC.md +1634 -0
- package/dist/elevenlabs/docs/text-to-speech/javascript/DOC.md +336 -0
- package/dist/elevenlabs/docs/text-to-speech/python/DOC.md +552 -0
- package/dist/firebase/docs/auth/DOC.md +1015 -0
- package/dist/gemini/docs/genai/javascript/DOC.md +691 -0
- package/dist/gemini/docs/genai/python/DOC.md +555 -0
- package/dist/github/docs/octokit/DOC.md +1560 -0
- package/dist/google/docs/bigquery/javascript/DOC.md +1688 -0
- package/dist/google/docs/bigquery/python/DOC.md +1503 -0
- package/dist/hubspot/docs/crm/javascript/DOC.md +1805 -0
- package/dist/hubspot/docs/crm/python/DOC.md +2033 -0
- package/dist/huggingface/docs/transformers/DOC.md +948 -0
- package/dist/intercom/docs/messaging/javascript/DOC.md +1844 -0
- package/dist/intercom/docs/messaging/python/DOC.md +1797 -0
- package/dist/jira/docs/issues/javascript/DOC.md +1420 -0
- package/dist/jira/docs/issues/python/DOC.md +1492 -0
- package/dist/kafka/docs/streaming/javascript/DOC.md +1671 -0
- package/dist/kafka/docs/streaming/python/DOC.md +1464 -0
- package/dist/landingai-ade/docs/api/DOC.md +620 -0
- package/dist/landingai-ade/docs/sdk/python/DOC.md +489 -0
- package/dist/landingai-ade/docs/sdk/typescript/DOC.md +542 -0
- package/dist/landingai-ade/skills/SKILL.md +489 -0
- package/dist/launchdarkly/docs/feature-flags/javascript/DOC.md +1191 -0
- package/dist/launchdarkly/docs/feature-flags/python/DOC.md +1671 -0
- package/dist/linear/docs/tracker/DOC.md +1554 -0
- package/dist/livekit/docs/realtime/javascript/DOC.md +303 -0
- package/dist/livekit/docs/realtime/python/DOC.md +163 -0
- package/dist/mailchimp/docs/marketing/DOC.md +1420 -0
- package/dist/meilisearch/docs/search/DOC.md +1241 -0
- package/dist/microsoft/docs/onedrive/javascript/DOC.md +1421 -0
- package/dist/microsoft/docs/onedrive/python/DOC.md +1549 -0
- package/dist/mongodb/docs/atlas/DOC.md +2041 -0
- package/dist/notion/docs/workspace-api/javascript/DOC.md +1435 -0
- package/dist/notion/docs/workspace-api/python/DOC.md +1400 -0
- package/dist/okta/docs/identity/javascript/DOC.md +1171 -0
- package/dist/okta/docs/identity/python/DOC.md +1401 -0
- package/dist/openai/docs/chat/javascript/DOC.md +407 -0
- package/dist/openai/docs/chat/python/DOC.md +568 -0
- package/dist/paypal/docs/checkout/DOC.md +278 -0
- package/dist/pinecone/docs/sdk/javascript/DOC.md +984 -0
- package/dist/pinecone/docs/sdk/python/DOC.md +1395 -0
- package/dist/plaid/docs/banking/javascript/DOC.md +1163 -0
- package/dist/plaid/docs/banking/python/DOC.md +1203 -0
- package/dist/playwright-community/skills/login-flows/SKILL.md +108 -0
- package/dist/postmark/docs/transactional-email/DOC.md +1168 -0
- package/dist/prisma/docs/orm/javascript/DOC.md +1419 -0
- package/dist/prisma/docs/orm/python/DOC.md +1317 -0
- package/dist/qdrant/docs/vector-search/javascript/DOC.md +1221 -0
- package/dist/qdrant/docs/vector-search/python/DOC.md +1653 -0
- package/dist/rabbitmq/docs/message-queue/javascript/DOC.md +1193 -0
- package/dist/rabbitmq/docs/message-queue/python/DOC.md +1243 -0
- package/dist/razorpay/docs/payments/javascript/DOC.md +1219 -0
- package/dist/razorpay/docs/payments/python/DOC.md +1330 -0
- package/dist/redis/docs/key-value/javascript/DOC.md +1851 -0
- package/dist/redis/docs/key-value/python/DOC.md +2054 -0
- package/dist/registry.json +2817 -0
- package/dist/replicate/docs/model-hosting/DOC.md +1318 -0
- package/dist/resend/docs/email/DOC.md +1271 -0
- package/dist/salesforce/docs/crm/javascript/DOC.md +1241 -0
- package/dist/salesforce/docs/crm/python/DOC.md +1183 -0
- package/dist/search-index.json +1 -0
- package/dist/sendgrid/docs/email-api/javascript/DOC.md +371 -0
- package/dist/sendgrid/docs/email-api/python/DOC.md +656 -0
- package/dist/sentry/docs/error-tracking/javascript/DOC.md +1073 -0
- package/dist/sentry/docs/error-tracking/python/DOC.md +1309 -0
- package/dist/shopify/docs/storefront/DOC.md +457 -0
- package/dist/slack/docs/workspace/javascript/DOC.md +933 -0
- package/dist/slack/docs/workspace/python/DOC.md +271 -0
- package/dist/square/docs/payments/javascript/DOC.md +1855 -0
- package/dist/square/docs/payments/python/DOC.md +1728 -0
- package/dist/stripe/docs/api/DOC.md +1727 -0
- package/dist/stripe/docs/payments/DOC.md +1726 -0
- package/dist/stytch/docs/auth/javascript/DOC.md +1813 -0
- package/dist/stytch/docs/auth/python/DOC.md +1962 -0
- package/dist/supabase/docs/client/DOC.md +1606 -0
- package/dist/twilio/docs/messaging/python/DOC.md +469 -0
- package/dist/twilio/docs/messaging/typescript/DOC.md +946 -0
- package/dist/vercel/docs/platform/DOC.md +1940 -0
- package/dist/weaviate/docs/vector-db/javascript/DOC.md +1268 -0
- package/dist/weaviate/docs/vector-db/python/DOC.md +1388 -0
- package/dist/zendesk/docs/support/javascript/DOC.md +2150 -0
- package/dist/zendesk/docs/support/python/DOC.md +2297 -0
- package/package.json +22 -6
- package/skills/get-api-docs/SKILL.md +84 -0
- package/src/commands/annotate.js +83 -0
- package/src/commands/build.js +12 -1
- package/src/commands/feedback.js +150 -0
- package/src/commands/get.js +83 -42
- package/src/commands/search.js +7 -0
- package/src/index.js +43 -17
- package/src/lib/analytics.js +90 -0
- package/src/lib/annotations.js +57 -0
- package/src/lib/bm25.js +170 -0
- package/src/lib/cache.js +69 -6
- package/src/lib/config.js +8 -3
- package/src/lib/identity.js +99 -0
- package/src/lib/registry.js +103 -20
- package/src/lib/telemetry.js +86 -0
- package/src/mcp/server.js +177 -0
- package/src/mcp/tools.js +251 -0
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: auth
|
|
3
|
+
description: "Clerk Backend API Python SDK for server-side authentication and user management operations"
|
|
4
|
+
metadata:
|
|
5
|
+
languages: "python"
|
|
6
|
+
versions: "3.3.1"
|
|
7
|
+
updated-on: "2026-03-01"
|
|
8
|
+
source: maintainer
|
|
9
|
+
tags: "clerk,auth,authentication,user-management,backend"
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Clerk Backend API Python SDK Coding Guidelines
|
|
13
|
+
|
|
14
|
+
You are a Clerk Backend API Python SDK expert. Help me with writing code using the Clerk Backend API Python SDK for authentication and user management operations.
|
|
15
|
+
|
|
16
|
+
Please follow the following guidelines when generating code.
|
|
17
|
+
|
|
18
|
+
## Golden Rule: Use the Correct and Current SDK
|
|
19
|
+
|
|
20
|
+
Always use the official Clerk Backend API Python SDK, which is automatically generated from the Clerk Backend API OpenAPI specification using Speakeasy.
|
|
21
|
+
|
|
22
|
+
- **Library Name:** Clerk Backend API Python SDK
|
|
23
|
+
- **Python Package:** `clerk-backend-api`
|
|
24
|
+
- **Main Class:** `Clerk`
|
|
25
|
+
|
|
26
|
+
**Installation:**
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pip install clerk-backend-api
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
**Basic Import:**
|
|
33
|
+
|
|
34
|
+
```python
|
|
35
|
+
from clerk_backend_api import Clerk
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Initialization and API Key
|
|
39
|
+
|
|
40
|
+
The Clerk SDK requires a secret key for authentication. Always initialize the client with your Clerk secret key:
|
|
41
|
+
|
|
42
|
+
```python
|
|
43
|
+
from clerk_backend_api import Clerk
|
|
44
|
+
|
|
45
|
+
# Initialize with secret key
|
|
46
|
+
clerk = Clerk(bearer_auth="sk_test_your_secret_key_here")
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Set your `CLERK_SECRET_KEY` environment variable for production use.
|
|
50
|
+
|
|
51
|
+
## Core SDK Structure
|
|
52
|
+
|
|
53
|
+
The SDK is organized into logical modules for different Clerk resources:
|
|
54
|
+
|
|
55
|
+
- **Users:** User management operations
|
|
56
|
+
- **Organizations:** Organization and membership management
|
|
57
|
+
- **Sessions:** Session management and verification
|
|
58
|
+
- **Email Addresses:** Email address operations
|
|
59
|
+
- **Phone Numbers:** Phone number operations
|
|
60
|
+
- **Invitations:** Organization invitations
|
|
61
|
+
- **JWT Templates:** Custom JWT configuration
|
|
62
|
+
- **OAuth Applications:** OAuth app management
|
|
63
|
+
- **Webhooks:** Webhook management
|
|
64
|
+
|
|
65
|
+
## Basic User Operations
|
|
66
|
+
|
|
67
|
+
### Create a User
|
|
68
|
+
|
|
69
|
+
```python
|
|
70
|
+
from clerk_backend_api import Clerk
|
|
71
|
+
|
|
72
|
+
clerk = Clerk(bearer_auth="sk_test_your_secret_key_here")
|
|
73
|
+
|
|
74
|
+
# Create a new user
|
|
75
|
+
response = clerk.users.create_user(
|
|
76
|
+
request_body={
|
|
77
|
+
"email_address": ["user@example.com"],
|
|
78
|
+
"password": "secure_password123",
|
|
79
|
+
"first_name": "John",
|
|
80
|
+
"last_name": "Doe"
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
user = response.object
|
|
85
|
+
print(f"Created user: {user.id}")
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Get a User
|
|
89
|
+
|
|
90
|
+
```python
|
|
91
|
+
# Get user by ID
|
|
92
|
+
response = clerk.users.get_user(user_id="user_123456789")
|
|
93
|
+
user = response.object
|
|
94
|
+
print(f"User email: {user.email_addresses[0].email_address}")
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### List Users
|
|
98
|
+
|
|
99
|
+
```python
|
|
100
|
+
# List all users with pagination
|
|
101
|
+
response = clerk.users.get_user_list(
|
|
102
|
+
limit=10,
|
|
103
|
+
offset=0,
|
|
104
|
+
order_by="-created_at"
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
for user in response.object:
|
|
108
|
+
print(f"User: {user.id} - {user.first_name} {user.last_name}")
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Update a User
|
|
112
|
+
|
|
113
|
+
```python
|
|
114
|
+
# Update user information
|
|
115
|
+
response = clerk.users.update_user(
|
|
116
|
+
user_id="user_123456789",
|
|
117
|
+
request_body={
|
|
118
|
+
"first_name": "Jane",
|
|
119
|
+
"last_name": "Smith"
|
|
120
|
+
}
|
|
121
|
+
)
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Session Management
|
|
125
|
+
|
|
126
|
+
### Verify a Session
|
|
127
|
+
|
|
128
|
+
```python
|
|
129
|
+
# Verify a session token
|
|
130
|
+
response = clerk.sessions.verify_session(
|
|
131
|
+
session_id="sess_123456789",
|
|
132
|
+
request_body={
|
|
133
|
+
"token": "session_token_here"
|
|
134
|
+
}
|
|
135
|
+
)
|
|
136
|
+
|
|
137
|
+
session = response.object
|
|
138
|
+
print(f"Session status: {session.status}")
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Get Session List
|
|
142
|
+
|
|
143
|
+
```python
|
|
144
|
+
# Get all sessions for a client
|
|
145
|
+
response = clerk.sessions.get_session_list(
|
|
146
|
+
client_id="client_123456789",
|
|
147
|
+
user_id="user_123456789"
|
|
148
|
+
)
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Organization Management
|
|
152
|
+
|
|
153
|
+
### Create an Organization
|
|
154
|
+
|
|
155
|
+
```python
|
|
156
|
+
# Create a new organization
|
|
157
|
+
response = clerk.organizations.create_organization(
|
|
158
|
+
request_body={
|
|
159
|
+
"name": "Acme Corp",
|
|
160
|
+
"slug": "acme-corp",
|
|
161
|
+
"created_by": "user_123456789"
|
|
162
|
+
}
|
|
163
|
+
)
|
|
164
|
+
|
|
165
|
+
org = response.object
|
|
166
|
+
print(f"Created organization: {org.id}")
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Add Organization Member
|
|
170
|
+
|
|
171
|
+
```python
|
|
172
|
+
# Add a user to an organization
|
|
173
|
+
response = clerk.organization_memberships.create_organization_membership(
|
|
174
|
+
organization_id="org_123456789",
|
|
175
|
+
request_body={
|
|
176
|
+
"user_id": "user_123456789",
|
|
177
|
+
"role": "basic_member"
|
|
178
|
+
}
|
|
179
|
+
)
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## Email and Phone Number Management
|
|
183
|
+
|
|
184
|
+
### Add Email Address
|
|
185
|
+
|
|
186
|
+
```python
|
|
187
|
+
# Add email address to user
|
|
188
|
+
response = clerk.email_addresses.create_email_address(
|
|
189
|
+
request_body={
|
|
190
|
+
"user_id": "user_123456789",
|
|
191
|
+
"email_address": "new@example.com",
|
|
192
|
+
"verified": False,
|
|
193
|
+
"primary": False
|
|
194
|
+
}
|
|
195
|
+
)
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### Add Phone Number
|
|
199
|
+
|
|
200
|
+
```python
|
|
201
|
+
# Add phone number to user
|
|
202
|
+
response = clerk.phone_numbers.create_phone_number(
|
|
203
|
+
request_body={
|
|
204
|
+
"user_id": "user_123456789",
|
|
205
|
+
"phone_number": "+1234567890",
|
|
206
|
+
"verified": False,
|
|
207
|
+
"primary": False
|
|
208
|
+
}
|
|
209
|
+
)
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
## JWT Templates
|
|
213
|
+
|
|
214
|
+
### Create JWT Template
|
|
215
|
+
|
|
216
|
+
```python
|
|
217
|
+
# Create custom JWT template
|
|
218
|
+
response = clerk.jwt_templates.create_jwt_template(
|
|
219
|
+
request_body={
|
|
220
|
+
"name": "custom_template",
|
|
221
|
+
"claims": {
|
|
222
|
+
"custom_claim": "{{user.id}}"
|
|
223
|
+
},
|
|
224
|
+
"lifetime": 3600,
|
|
225
|
+
"allowed_clock_skew": 5
|
|
226
|
+
}
|
|
227
|
+
)
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
## Webhook Management
|
|
231
|
+
|
|
232
|
+
### Create Webhook Endpoint
|
|
233
|
+
|
|
234
|
+
```python
|
|
235
|
+
# Create webhook endpoint
|
|
236
|
+
response = clerk.webhooks.create_webhook(
|
|
237
|
+
request_body={
|
|
238
|
+
"url": "https://your-app.com/webhooks/clerk",
|
|
239
|
+
"events": ["user.created", "user.updated", "session.created"]
|
|
240
|
+
}
|
|
241
|
+
)
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
## Error Handling
|
|
245
|
+
|
|
246
|
+
The SDK uses structured error responses. Always handle potential errors:
|
|
247
|
+
|
|
248
|
+
```python
|
|
249
|
+
from clerk_backend_api import Clerk
|
|
250
|
+
from clerk_backend_api.models import ClerkErrors
|
|
251
|
+
|
|
252
|
+
clerk = Clerk(bearer_auth="sk_test_your_secret_key_here")
|
|
253
|
+
|
|
254
|
+
try:
|
|
255
|
+
response = clerk.users.get_user(user_id="invalid_user_id")
|
|
256
|
+
user = response.object
|
|
257
|
+
except Exception as e:
|
|
258
|
+
if hasattr(e, 'errors'):
|
|
259
|
+
for error in e.errors:
|
|
260
|
+
print(f"Error: {error.message} (Code: {error.code})")
|
|
261
|
+
else:
|
|
262
|
+
print(f"Unexpected error: {e}")
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
## Dependencies and Requirements
|
|
266
|
+
|
|
267
|
+
The SDK includes the following key dependencies:
|
|
268
|
+
|
|
269
|
+
- `cryptography ^43.0.1` - For cryptographic operations
|
|
270
|
+
- `pyjwt ^2.9.0` - For JWT token handling
|
|
271
|
+
|
|
272
|
+
## SDK Configuration
|
|
273
|
+
|
|
274
|
+
The SDK is automatically generated and maintained using Speakeasy configuration. The current version is `2.0.2` and includes comprehensive type hints and documentation.
|