@smplkit/sdk 1.6.1 → 1.6.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.
- package/README.md +29 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -34,28 +34,49 @@ const client3 = new SmplClient();
|
|
|
34
34
|
|
|
35
35
|
## Configuration
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
All settings are resolved from three sources, in order of precedence:
|
|
38
38
|
|
|
39
|
-
1. **
|
|
40
|
-
2. **Environment
|
|
41
|
-
3. **Configuration file
|
|
39
|
+
1. **Constructor options** — highest priority, always wins.
|
|
40
|
+
2. **Environment variables** — e.g. `SMPLKIT_API_KEY`, `SMPLKIT_ENVIRONMENT`.
|
|
41
|
+
3. **Configuration file** (`~/.smplkit`) — INI-format with profile support.
|
|
42
|
+
4. **Defaults** — built-in SDK defaults.
|
|
43
|
+
|
|
44
|
+
### Configuration File
|
|
45
|
+
|
|
46
|
+
The `~/.smplkit` file supports a `[common]` section (applied to all profiles) and named profiles:
|
|
42
47
|
|
|
43
48
|
```ini
|
|
44
|
-
|
|
49
|
+
[common]
|
|
50
|
+
environment = production
|
|
51
|
+
service = my-app
|
|
45
52
|
|
|
46
53
|
[default]
|
|
47
|
-
api_key =
|
|
54
|
+
api_key = sk_api_abc123
|
|
55
|
+
|
|
56
|
+
[local]
|
|
57
|
+
base_domain = localhost
|
|
58
|
+
scheme = http
|
|
59
|
+
api_key = sk_api_local_xyz
|
|
60
|
+
environment = development
|
|
61
|
+
debug = true
|
|
48
62
|
```
|
|
49
63
|
|
|
50
|
-
|
|
64
|
+
### Constructor Examples
|
|
51
65
|
|
|
52
66
|
```typescript
|
|
67
|
+
// Use a named profile
|
|
68
|
+
const client = new SmplClient({ profile: "local" });
|
|
69
|
+
|
|
70
|
+
// Or configure explicitly
|
|
53
71
|
const client = new SmplClient({
|
|
54
72
|
apiKey: "sk_api_...",
|
|
55
|
-
|
|
73
|
+
environment: "production",
|
|
74
|
+
service: "my-service",
|
|
56
75
|
});
|
|
57
76
|
```
|
|
58
77
|
|
|
78
|
+
For the complete configuration reference, see the [Configuration Guide](https://docs.smplkit.com/getting-started/configuration).
|
|
79
|
+
|
|
59
80
|
## Config
|
|
60
81
|
|
|
61
82
|
### Runtime (resolve config values)
|