@settlr/sdk 0.4.2 → 0.4.3

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.
Files changed (2) hide show
  1. package/README.md +11 -6
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -28,7 +28,7 @@ npm install @settlr/sdk
28
28
 
29
29
  ### 1. Get Your API Key
30
30
 
31
- Sign up at [settlr.app/dashboard](https://settlr.app/dashboard) and create an API key.
31
+ Sign up at [settlr.dev/onboarding](https://settlr.dev/onboarding) to register your business and get an API key. Your wallet address is linked to your API key automatically.
32
32
 
33
33
  ### 2. Create a Payment Link
34
34
 
@@ -36,10 +36,10 @@ Sign up at [settlr.app/dashboard](https://settlr.app/dashboard) and create an AP
36
36
  import { Settlr } from "@settlr/sdk";
37
37
 
38
38
  const settlr = new Settlr({
39
- apiKey: "sk_live_xxxxxxxxxxxx", // Your API key
39
+ apiKey: "sk_live_xxxxxxxxxxxx", // Your API key from dashboard
40
40
  merchant: {
41
41
  name: "My Store",
42
- walletAddress: "YOUR_SOLANA_WALLET_ADDRESS",
42
+ // walletAddress is optional - automatically fetched from your API key
43
43
  },
44
44
  });
45
45
 
@@ -52,6 +52,8 @@ const payment = await settlr.createPayment({
52
52
  window.location.href = payment.checkoutUrl;
53
53
  ```
54
54
 
55
+ > **Note:** When you register at [settlr.dev/onboarding](https://settlr.dev/onboarding), your wallet address is linked to your API key. The SDK automatically fetches it - no need to include it in your code!
56
+
55
57
  ### 3. Drop-in Buy Button ⭐ NEW
56
58
 
57
59
  The easiest way to accept payments - just drop in a button:
@@ -64,7 +66,7 @@ function App() {
64
66
  <SettlrProvider
65
67
  config={{
66
68
  apiKey: "sk_live_xxxxxxxxxxxx",
67
- merchant: { name: "GameStore", walletAddress: "YOUR_WALLET" },
69
+ merchant: { name: "GameStore" }, // Wallet fetched from API key
68
70
  }}
69
71
  >
70
72
  <BuyButton
@@ -120,7 +122,7 @@ function App() {
120
122
  apiKey: "sk_live_xxxxxxxxxxxx",
121
123
  merchant: {
122
124
  name: "My Game",
123
- walletAddress: "YOUR_WALLET",
125
+ // walletAddress optional - linked to your API key
124
126
  },
125
127
  }}
126
128
  >
@@ -245,9 +247,10 @@ Main client class.
245
247
 
246
248
  ```typescript
247
249
  interface SettlrConfig {
250
+ apiKey: string; // Required: your API key from dashboard
248
251
  merchant: {
249
252
  name: string;
250
- walletAddress: string;
253
+ walletAddress?: string; // Optional: auto-fetched from API key
251
254
  logoUrl?: string;
252
255
  webhookUrl?: string;
253
256
  };
@@ -257,6 +260,8 @@ interface SettlrConfig {
257
260
  }
258
261
  ```
259
262
 
263
+ > **Tip:** When you register at [settlr.dev/onboarding](https://settlr.dev/onboarding), your wallet address is linked to your API key. You don't need to specify it in the config!
264
+
260
265
  #### Methods
261
266
 
262
267
  ##### `createPayment(options)`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@settlr/sdk",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "Settlr SDK - Accept Solana USDC payments in games and apps. Email checkout, gasless transactions, no wallet required. The easiest way to add crypto payments.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",