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,278 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: checkout
|
|
3
|
+
description: "PayPal JavaScript SDK for integrating checkout, payments, subscriptions, and orders into web applications."
|
|
4
|
+
metadata:
|
|
5
|
+
languages: "javascript"
|
|
6
|
+
versions: "1.0.3"
|
|
7
|
+
updated-on: "2026-03-01"
|
|
8
|
+
source: maintainer
|
|
9
|
+
tags: "paypal,payments,checkout,subscriptions,orders"
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# PayPal JavaScript SDK Coding Guide
|
|
13
|
+
|
|
14
|
+
## 1. Golden Rule
|
|
15
|
+
|
|
16
|
+
**Always use the official PayPal JavaScript SDK packages:**
|
|
17
|
+
- Core SDK: `@paypal/paypal-js`
|
|
18
|
+
- React wrapper: `@paypal/react-paypal-js`
|
|
19
|
+
|
|
20
|
+
**Never use deprecated or unofficial libraries.** These are the only supported PayPal JS SDK packages maintained by PayPal.
|
|
21
|
+
|
|
22
|
+
## 2. Installation
|
|
23
|
+
|
|
24
|
+
### npm
|
|
25
|
+
```bash
|
|
26
|
+
npm install @paypal/paypal-js
|
|
27
|
+
# For React applications
|
|
28
|
+
npm install @paypal/react-paypal-js
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### yarn
|
|
32
|
+
```bash
|
|
33
|
+
yarn add @paypal/paypal-js
|
|
34
|
+
# For React applications
|
|
35
|
+
yarn add @paypal/react-paypal-js
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### pnpm
|
|
39
|
+
```bash
|
|
40
|
+
pnpm add @paypal/paypal-js
|
|
41
|
+
# For React applications
|
|
42
|
+
pnpm add @paypal/react-paypal-js
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Environment Variables (Optional):**
|
|
46
|
+
```bash
|
|
47
|
+
PAYPAL_CLIENT_ID=your_client_id_here
|
|
48
|
+
PAYPAL_ENVIRONMENT=sandbox # or production
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## 3. Initialization
|
|
52
|
+
|
|
53
|
+
### Vanilla JavaScript
|
|
54
|
+
```javascript
|
|
55
|
+
import { loadScript } from "@paypal/paypal-js";
|
|
56
|
+
|
|
57
|
+
// Basic initialization
|
|
58
|
+
const paypal = await loadScript({
|
|
59
|
+
clientId: "your-client-id",
|
|
60
|
+
currency: "USD"
|
|
61
|
+
});
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### React Application
|
|
65
|
+
```javascript
|
|
66
|
+
import { PayPalScriptProvider } from "@paypal/react-paypal-js";
|
|
67
|
+
|
|
68
|
+
function App() {
|
|
69
|
+
const initialOptions = {
|
|
70
|
+
clientId: "your-client-id",
|
|
71
|
+
currency: "USD",
|
|
72
|
+
intent: "capture"
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
return (
|
|
76
|
+
<PayPalScriptProvider options={initialOptions}>
|
|
77
|
+
{/* Your PayPal components here */}
|
|
78
|
+
</PayPalScriptProvider>
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
The `PayPalScriptProvider` manages script loading and provides context to child components using React's Context API.
|
|
84
|
+
|
|
85
|
+
## 4. Core API Surfaces
|
|
86
|
+
|
|
87
|
+
### PayPal Buttons
|
|
88
|
+
|
|
89
|
+
**Minimal Example:**
|
|
90
|
+
```javascript
|
|
91
|
+
import { PayPalButtons } from "@paypal/react-paypal-js";
|
|
92
|
+
|
|
93
|
+
<PayPalButtons
|
|
94
|
+
createOrder={(data, actions) => {
|
|
95
|
+
return actions.order.create({
|
|
96
|
+
purchase_units: [{
|
|
97
|
+
amount: { value: "10.00" }
|
|
98
|
+
}]
|
|
99
|
+
});
|
|
100
|
+
}}
|
|
101
|
+
onApprove={(data, actions) => {
|
|
102
|
+
return actions.order.capture();
|
|
103
|
+
}}
|
|
104
|
+
/>
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**Advanced Example:**
|
|
108
|
+
```javascript
|
|
109
|
+
<PayPalButtons
|
|
110
|
+
style={{
|
|
111
|
+
layout: "vertical",
|
|
112
|
+
color: "gold",
|
|
113
|
+
shape: "rect",
|
|
114
|
+
label: "paypal"
|
|
115
|
+
}}
|
|
116
|
+
createOrder={createOrder}
|
|
117
|
+
onApprove={onApprove}
|
|
118
|
+
onCancel={onCancel}
|
|
119
|
+
onError={onError}
|
|
120
|
+
fundingSource="paypal"
|
|
121
|
+
disabled={false}
|
|
122
|
+
forceReRender={[amount, currency]}
|
|
123
|
+
/>
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Braintree Integration
|
|
127
|
+
|
|
128
|
+
**Minimal Example:**
|
|
129
|
+
```javascript
|
|
130
|
+
import { BraintreePayPalButtons } from "@paypal/react-paypal-js";
|
|
131
|
+
|
|
132
|
+
<PayPalScriptProvider options={{
|
|
133
|
+
clientId: "your-client-id",
|
|
134
|
+
dataClientToken: "your-braintree-client-token"
|
|
135
|
+
}}>
|
|
136
|
+
<BraintreePayPalButtons
|
|
137
|
+
createOrder={(data, actions) => {
|
|
138
|
+
return actions.braintree.createPayment({
|
|
139
|
+
flow: "checkout",
|
|
140
|
+
amount: "10.00",
|
|
141
|
+
currency: "USD"
|
|
142
|
+
});
|
|
143
|
+
}}
|
|
144
|
+
onApprove={(data, actions) => {
|
|
145
|
+
return actions.braintree.tokenizePayment(data);
|
|
146
|
+
}}
|
|
147
|
+
/>
|
|
148
|
+
</PayPalScriptProvider>
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Messages and Marks
|
|
152
|
+
```javascript
|
|
153
|
+
import { PayPalMessages, PayPalMarks } from "@paypal/react-paypal-js";
|
|
154
|
+
|
|
155
|
+
<PayPalMessages
|
|
156
|
+
amount="10.00"
|
|
157
|
+
placement="home"
|
|
158
|
+
style={{
|
|
159
|
+
layout: "text",
|
|
160
|
+
logo: { type: "primary" }
|
|
161
|
+
}}
|
|
162
|
+
/>
|
|
163
|
+
|
|
164
|
+
<PayPalMarks />
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## 5. Advanced Features
|
|
168
|
+
|
|
169
|
+
### Error Handling
|
|
170
|
+
|
|
171
|
+
The SDK provides comprehensive error handling through callback functions and component lifecycle management:
|
|
172
|
+
|
|
173
|
+
```javascript
|
|
174
|
+
const onError = (err) => {
|
|
175
|
+
console.error("PayPal error:", err);
|
|
176
|
+
// Handle specific error types
|
|
177
|
+
if (err.name === "VALIDATION_ERROR") {
|
|
178
|
+
// Handle validation errors
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
<PayPalButtons
|
|
183
|
+
onError={onError}
|
|
184
|
+
onCancel={onCancel}
|
|
185
|
+
// other props
|
|
186
|
+
/>
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
The PayPal Buttons component includes built-in error handling that catches rendering failures and SDK initialization errors.
|
|
190
|
+
|
|
191
|
+
### Script Loading States
|
|
192
|
+
|
|
193
|
+
```javascript
|
|
194
|
+
import { usePayPalScriptReducer } from "@paypal/react-paypal-js";
|
|
195
|
+
|
|
196
|
+
function PayPalStatus() {
|
|
197
|
+
const [{ isLoaded, isPending, isRejected }] = usePayPalScriptReducer();
|
|
198
|
+
|
|
199
|
+
if (isPending) return <div>Loading PayPal SDK...</div>;
|
|
200
|
+
if (isLoaded) return <div>SDK ready</div>;
|
|
201
|
+
if (isRejected) return <div>Failed to load SDK</div>;
|
|
202
|
+
}
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### Component Lifecycle Management
|
|
206
|
+
|
|
207
|
+
The PayPal components handle their lifecycle automatically, including cleanup when components unmount:
|
|
208
|
+
|
|
209
|
+
### Dynamic Configuration
|
|
210
|
+
|
|
211
|
+
```javascript
|
|
212
|
+
import { DISPATCH_ACTION } from "@paypal/react-paypal-js";
|
|
213
|
+
|
|
214
|
+
const [{ options }, dispatch] = usePayPalScriptReducer();
|
|
215
|
+
|
|
216
|
+
// Update currency dynamically
|
|
217
|
+
dispatch({
|
|
218
|
+
type: DISPATCH_ACTION.RESET_OPTIONS,
|
|
219
|
+
value: {
|
|
220
|
+
...options,
|
|
221
|
+
currency: "EUR"
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### Eligibility Checking
|
|
227
|
+
|
|
228
|
+
The SDK automatically checks component eligibility before rendering:
|
|
229
|
+
|
|
230
|
+
## 6. TypeScript Usage
|
|
231
|
+
|
|
232
|
+
### Import Types
|
|
233
|
+
```typescript
|
|
234
|
+
import type {
|
|
235
|
+
PayPalScriptOptions,
|
|
236
|
+
PayPalButtonsComponentOptions,
|
|
237
|
+
PayPalNamespace,
|
|
238
|
+
FUNDING_SOURCE
|
|
239
|
+
} from "@paypal/paypal-js";
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### Type-Safe Component Usage
|
|
243
|
+
```typescript
|
|
244
|
+
import { PayPalButtons } from "@paypal/react-paypal-js";
|
|
245
|
+
import type { PayPalButtonsComponentOptions } from "@paypal/paypal-js";
|
|
246
|
+
|
|
247
|
+
const buttonOptions: PayPalButtonsComponentOptions = {
|
|
248
|
+
style: {
|
|
249
|
+
layout: "vertical",
|
|
250
|
+
color: "gold"
|
|
251
|
+
},
|
|
252
|
+
createOrder: (data, actions) => {
|
|
253
|
+
return actions.order.create({
|
|
254
|
+
purchase_units: [{
|
|
255
|
+
amount: { value: "10.00" }
|
|
256
|
+
}]
|
|
257
|
+
});
|
|
258
|
+
},
|
|
259
|
+
onApprove: (data, actions) => {
|
|
260
|
+
return actions.order.capture();
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
<PayPalButtons {...buttonOptions} />
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
### Script Options Interface
|
|
268
|
+
```typescript
|
|
269
|
+
const scriptOptions: PayPalScriptOptions = {
|
|
270
|
+
clientId: "your-client-id",
|
|
271
|
+
currency: "USD",
|
|
272
|
+
components: ["buttons", "marks"],
|
|
273
|
+
disableFunding: ["credit", "card"],
|
|
274
|
+
dataClientToken: "braintree-token"
|
|
275
|
+
};
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
|