@gitterm/sdk 0.6.0 → 0.7.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 +4 -2
- package/dist/direct/index.js +1806 -271
- package/dist/direct/types.d.ts +59 -21
- package/dist/index.js +22 -12
- package/dist/transport.d.ts +7 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -118,12 +118,14 @@ without a GitTerm server, is described at the [end](#direct-provider-mode).
|
|
|
118
118
|
`createGittermClient()` resolves its server and token in this order: constructor options →
|
|
119
119
|
`GITTERM_SERVER_URL` / `GITTERM_API_TOKEN` → the CLI config at `~/.config/gitterm/cli.json`
|
|
120
120
|
written by `gitterm login`. The default server is the hosted API at `https://api.gitterm.dev`;
|
|
121
|
-
self-hosted instances use the same SDK with their own `serverUrl
|
|
121
|
+
self-hosted instances use the same SDK with their own `serverUrl`. Behind the bundled
|
|
122
|
+
path-routing proxy, point it at the `/api` path (for example
|
|
123
|
+
`GITTERM_SERVER_URL=https://<host>/api`); a server reached directly uses its origin:
|
|
122
124
|
|
|
123
125
|
```ts
|
|
124
126
|
const hosted = createGittermClient({ token: process.env.GITTERM_API_TOKEN });
|
|
125
127
|
const selfHosted = createGittermClient({
|
|
126
|
-
serverUrl: "https://gitterm.example.com", // or http://localhost:3000
|
|
128
|
+
serverUrl: "https://gitterm.example.com/api", // or http://localhost:3000
|
|
127
129
|
token: process.env.GITTERM_API_TOKEN,
|
|
128
130
|
});
|
|
129
131
|
const fromCli = createGittermClient(); // env vars, then the CLI's saved login
|