You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17Lines changed: 17 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,23 @@ yarn:
34
34
yarn add @ftrack/api
35
35
```
36
36
37
+
## TypeScript: Generated Schema Types
38
+
39
+
You can generate schema types for your own workspace with [@ftrack/ts-schema-generator](https://github.com/ftrackhq/ftrack-ts-schema-generator).
40
+
41
+
Once generated, you can integrate them with @ftrack/api by passing them as a type variable:
42
+
43
+
```ts
44
+
importSchemaTypesfrom"./__generated__/schema.ts"
45
+
import { Session } from @ftrack/api
46
+
47
+
const session =newSession<SchemaTypes>(...);
48
+
49
+
// user will now be of type User
50
+
// and provide all available properties for its entity type.
51
+
const user =awaitsession.query<"User">("...");
52
+
```
53
+
37
54
## Tutorial
38
55
39
56
The API uses sessions to manage communication with an ftrack server. Create a session that connects to your ftrack server (changing the passed values as appropriate):
0 commit comments