<@U04UQ68083H> What types are provided with the or...
# ory-copilot
w
@chilly-king-10285 What types are provided with the ory client library for nodejs, some things shouldn't have to infer an any type?
c
A message from kapa.ai
The Ory client library for Node.js (published as @ory/client) provides full TypeScript type definitions out of the box. This means you should not have to infer or fall back to any types for the main SDK usage. The SDK exposes types for all API methods, request/response payloads, and configuration objects, ensuring type safety and autocompletion in TypeScript and modern JavaScript editors. For example, when you import and use the SDK, you get types for: - API clients (e.g., IdentityApi, OAuth2Api, FrontendApi) - Configuration objects (e.g., Configuration) - All method parameters and return values Here’s a basic usage example showing typed configuration and API usage:
Copy code
typescript 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:
Copy code
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).