@keystrokehq/keystroke 0.1.78 → 0.1.80
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 +18 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -39,20 +39,30 @@ import { defineConfig } from "@keystrokehq/keystroke/config";
|
|
|
39
39
|
import { defineCredential } from "@keystrokehq/keystroke/credentials";
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
## Custom
|
|
42
|
+
## Custom apps
|
|
43
|
+
|
|
44
|
+
For a credentialed custom integration, use `defineApp` (not a standalone credential file):
|
|
43
45
|
|
|
44
46
|
```typescript
|
|
45
|
-
import {
|
|
47
|
+
import { defineApp } from "@keystrokehq/keystroke/app";
|
|
46
48
|
import { z } from "zod";
|
|
47
49
|
|
|
48
|
-
export const
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
export const customApp = defineApp({
|
|
51
|
+
slug: "custom-app",
|
|
52
|
+
auth: "api_key",
|
|
53
|
+
credential: { apiKey: z.string() },
|
|
51
54
|
});
|
|
52
|
-
```
|
|
53
55
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
export const doThing = customApp.action({
|
|
57
|
+
slug: "do-thing",
|
|
58
|
+
input: z.object({ id: z.string() }),
|
|
59
|
+
output: z.object({ ok: z.boolean() }),
|
|
60
|
+
async run(input, credentials) {
|
|
61
|
+
return callApi(input.id, credentials["custom-app"].apiKey);
|
|
62
|
+
},
|
|
63
|
+
});
|
|
56
64
|
```
|
|
57
65
|
|
|
66
|
+
Register a connectable org app with `keystroke apps create` when users should connect via the Apps UI, then `keystroke connect custom-app` (or `credentials create`). See the custom apps docs.
|
|
67
|
+
|
|
58
68
|
Direct `@keystrokehq/action` (and other primitive) imports remain valid.
|