wooden-addition-60810
09/18/2025, 4:47 PMchilly-king-10285
09/18/2025, 4:47 PMchilly-king-10285
09/18/2025, 4:47 PMtypescript import { Configuration, IdentityApi, OAuth2Api, FrontendApi, } from "@ory/client" const config = new Configuration({ basePath: "https://{your-project}.<http://projects.oryapis.com/|projects.oryapis.com/>", accessToken: process.env.ORY_API_KEY, baseOptions: { withCredentials: true, timeout: 30000, }, }) const ory = { identity: new IdentityApi(config), frontend: new FrontendApi(config), oauth2: new OAuth2Api(config), }
When calling methods, parameters are also typed: typescript ory.frontend.toSession({ cookie: "", // xSessionToken: result.session_token, })
The SDK is designed to provide a robust developer experience with TypeScript, so you should not need to use any or manually infer types for the main API surface. If you encounter any missing types, it may be a bug or a gap in the SDK, and you can report it to the Ory team. For more details, see the [Ory SDK documentation](https://www.ory.sh/docs/sdk) and the [SDK V1 upgrade guide](https://www.ory.sh/docs/guides/upgrade/sdk-v1) which highlights the improved type support and naming conventions in the latest versions. The SDK is also listed on [npmjs.com](https://www.npmjs.com/package/@ory/client) and provides TypeScript definitions by default[Software Development Kits (SDKs) for Ory](https://www.ory.sh/docs/sdk) [SDK V1 upgrade guide](https://www.ory.sh/docs/guides/upgrade/sdk-v1).