@blazium/sdk 1.0.1 → 1.0.2

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 +37 -24
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -16,36 +16,49 @@ Official Node.js SDK for BlaziumPay - Production-ready crypto payment infrastruc
16
16
  ## Installation
17
17
 
18
18
  ```bash
19
- npm install @blazium/sdk
19
+ npm install @blazium/sdk dotenv
20
20
  ```
21
21
 
22
- ## Quick Start
22
+ ## Configuration
23
23
 
24
- ```typescript
25
- import { BlaziumPayClient } from '@blazium/sdk';
24
+ Create a `.env` file in your project root:
26
25
 
27
- const client = new BlaziumPayClient({
28
- apiKey: process.env.BLAZIUM_API_KEY,
29
- webhookSecret: process.env.BLAZIUM_WEBHOOK_SECRET,
30
- environment: 'production'
31
- });
26
+ ```env
27
+ BLAZIUM_API_KEY=bz_test_...
28
+ BLAZIUM_WEBHOOK_SECRET=whsec_...
29
+ ```
32
30
 
33
- // Create payment with locked reward
34
- const payment = await client.createPayment(
35
- {
36
- amount: 10.00,
37
- currency: 'USD',
38
- description: 'Premium Pack',
39
- rewardAmount: 400,
40
- rewardCurrency: 'coins'
41
- },
42
- {
43
- idempotencyKey: 'order_12345'
44
- }
45
- );
31
+ ## Quick Start
32
+
33
+ ```typescript
34
+ import 'dotenv/config'; // Load environment variables
35
+ import { BlaziumPayClient, BlaziumEnvironment, BlaziumFiat } from '@blazium/sdk';
36
+
37
+ // Wrap in async function to allow await
38
+ (async () => {
39
+ const client = new BlaziumPayClient({
40
+ apiKey: process.env.BLAZIUM_API_KEY as string,
41
+ webhookSecret: process.env.BLAZIUM_WEBHOOK_SECRET,
42
+ environment: BlaziumEnvironment.PRODUCTION
43
+ });
44
+
45
+ // Create payment with locked reward
46
+ const payment = await client.createPayment(
47
+ {
48
+ amount: 10.00,
49
+ currency: BlaziumFiat.USD,
50
+ description: 'Premium Pack',
51
+ rewardAmount: 400,
52
+ rewardCurrency: 'coins'
53
+ },
54
+ {
55
+ idempotencyKey: 'order_12345'
56
+ }
57
+ );
46
58
 
47
- console.log('Checkout URL:', payment.checkoutUrl);
48
- console.log('Reward (LOCKED):', payment.rewardAmount); // Always 400
59
+ console.log('Checkout URL:', payment.checkoutUrl);
60
+ console.log('Reward (LOCKED):', payment.rewardAmount); // Always 400
61
+ })();
49
62
  ```
50
63
 
51
64
  ## Core Concepts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blazium/sdk",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Official Node.js SDK for BlaziumPay - Production-ready crypto payment infrastructure for TON, Solana, and Bitcoin",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",