npm package: @ory/hydra-client-fetch
Description: OpenAPI client for @ory/hydra-client-fetch
Author: Ory Corp
Latest version: 26.2.0

# @ory/hydra-client-fetch@v26.2.0

A TypeScript SDK client for the localhost API.

## Usage

First, install the SDK from npm.

```bash
npm install @ory/hydra-client-fetch --save
```

Next, try it out.


```ts
import {
  Configuration,
  JwkApi,
} from '@ory/hydra-client-fetch';
import type { CreateJsonWebKeySetRequest } from '@ory/hydra-client-fetch';

async function example() {
  console.log("🚀 Testing @ory/hydra-client-fetch SDK...");
  const api = new JwkApi();

  const body = {
    // string | The JSON Web Key Set ID
    set: set_example,
    // CreateJsonWebKeySet
    createJsonWebKeySet: ...,
  } satisfies CreateJsonWebKeySetRequest;

  try {
    const data = await api.createJsonWebKeySet(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);
```


## Documentation

### API Endpoints

All URIs are relative to *http://localhost*

| Class | Method | HTTP request | Description
| ----- | ------ | ------------ | -------------
*JwkApi* | [**createJsonWebKeySet**](docs/JwkApi.md#createjsonwebkeyset) | **POST** /admin/keys/{set} | Create JSON Web Key
*JwkApi* | [**deleteJsonWebKey**](docs/JwkApi.md#deletejsonwebkey) | **DELETE** /admin/keys/{set}/{kid} | Delete JSON Web Key
*JwkApi* | [**deleteJsonWebKeySet**](docs/JwkApi.md#deletejsonwebkeyset) | **DELETE** /admin/keys/{set} | Delete JSON Web Key Set
*JwkApi* | [**getJsonWebKey**](docs/JwkApi.md#getjsonwebkey) | **GET** /admin/keys/{set}/{kid} | Get JSON Web Key
*JwkApi* | [**getJsonWebKeySet**](docs/JwkApi.md#getjsonwebkeyset) | **GET** /admin/keys/{set} | Retrieve a JSON Web Key Set
*JwkApi* | [**setJsonWebKey**](docs/JwkApi.md#setjsonwebkey) | **PUT** /admin/keys/{set}/{kid} | Set JSON Web Key
*JwkApi* | [**setJsonWebKeySet**](docs/JwkApi.md#setjsonwebkeyset) | **PUT** /admin/keys/{set} | Update a JSON Web Key Set
*MetadataApi* | [**getVersion**](docs/MetadataApi.md#getversion) | **GET** /version | Return Running Software Version.
*MetadataApi* | [**isAlive**](docs/MetadataApi.md#isalive) | **GET** /health/alive | Check HTTP Server Status
*MetadataApi* | [**isReady**](docs/MetadataApi.md#isready) | **GET** /health/ready | Check HTTP Server and Database Status
*OAuth2Api* | [**acceptOAuth2ConsentRequest**](docs/OAuth2Api.md#acceptoauth2consentrequest) | **PUT** /admin/oauth2/auth/requests/consent/accept | Accept OAuth 2.0 Consent Request
*OAuth2Api* | [**acceptOAuth2LoginRequest**](docs/OAuth2Api.md#acceptoauth2loginrequest) | **PUT** /admin/oauth2/auth/requests/login/accept | Accept OAuth 2.0 Login Request
*OAuth2Api* | [**acceptOAuth2LogoutRequest**](docs/OAuth2Api.md#acceptoauth2logoutrequest) | **PUT** /admin/oauth2/auth/requests/logout/accept | Accept OAuth 2.0 Session Logout Request
*OAuth2Api* | [**acceptUserCodeRequest**](docs/OAuth2Api.md#acceptusercoderequest) | **PUT** /admin/oauth2/auth/requests/device/accept | Accepts a device grant user_code request
*OAuth2Api* | [**createOAuth2Client**](docs/OAuth2Api.md#createoauth2client) | **POST** /admin/clients | Create OAuth 2.0 Client
*OAuth2Api* | [**deleteOAuth2Client**](docs/OAuth2Api.md#deleteoauth2client) | **DELETE** /admin/clients/{id} | Delete OAuth 2.0 Client
*OAuth2Api* | [**deleteOAuth2Token**](docs/OAuth2Api.md#deleteoauth2token) | **DELETE** /admin/oauth2/tokens | Delete OAuth 2.0 Access Tokens from specific OAuth 2.0 Client
*OAuth2Api* | [**deleteTrustedOAuth2JwtGrantIssuer**](docs/OAuth2Api.md#deletetrustedoauth2jwtgrantissuer) | **DELETE** /admin/trust/grants/jwt-bearer/issuers/{id} | Delete Trusted OAuth2 JWT Bearer Grant Type Issuer
*OAuth2Api* | [**getOAuth2Client**](docs/OAuth2Api.md#getoauth2client) | **GET** /admin/clients/{id} | Get an OAuth 2.0 Client
*OAuth2Api* | [**getOAuth2ConsentRequest**](docs/OAuth2Api.md#getoauth2consentrequest) | **GET** /admin/oauth2/auth/requests/consent | Get OAuth 2.0 Consent Request
*OAuth2Api* | [**getOAuth2LoginRequest**](docs/OAuth2Api.md#getoauth2loginrequest) | **GET** /admin/oauth2/auth/requests/login | Get OAuth 2.0 Login Request
*OAuth2Api* | [**getOAuth2LogoutRequest**](docs/OAuth2Api.md#getoauth2logoutrequest) | **GET** /admin/oauth2/auth/requests/logout | Get OAuth 2.0 Session Logout Request
*OAuth2Api* | [**getTrustedOAuth2JwtGrantIssuer**](docs/OAuth2Api.md#gettrustedoauth2jwtgrantissuer) | **GET** /admin/trust/grants/jwt-bearer/issuers/{id} | Get Trusted OAuth2 JWT Bearer Grant Type Issuer
*OAuth2Api* | [**introspectOAuth2Token**](docs/OAuth2Api.md#introspectoauth2token) | **POST** /admin/oauth2/introspect | Introspect OAuth2 Access and Refresh Tokens
*OAuth2Api* | [**listOAuth2Clients**](docs/OAuth2Api.md#listoauth2clients) | **GET** /admin/clients | List OAuth 2.0 Clients
*OAuth2Api* | [**listOAuth2ConsentSessions**](docs/OAuth2Api.md#listoauth2consentsessions) | **GET** /admin/oauth2/auth/sessions/consent | List OAuth 2.0 Consent Sessions of a Subject
*OAuth2Api* | [**listTrustedOAuth2JwtGrantIssuers**](docs/OAuth2Api.md#listtrustedoauth2jwtgrantissuers) | **GET** /admin/trust/grants/jwt-bearer/issuers | List Trusted OAuth2 JWT Bearer Grant Type Issuers
*OAuth2Api* | [**oAuth2Authorize**](docs/OAuth2Api.md#oauth2authorize) | **GET** /oauth2/auth | OAuth 2.0 Authorize Endpoint
*OAuth2Api* | [**oAuth2DeviceFlow**](docs/OAuth2Api.md#oauth2deviceflow) | **POST** /oauth2/device/auth | The OAuth 2.0 Device Authorize Endpoint
*OAuth2Api* | [**oauth2TokenExchange**](docs/OAuth2Api.md#oauth2tokenexchange) | **POST** /oauth2/token | The OAuth 2.0 Token Endpoint
*OAuth2Api* | [**patchOAuth2Client**](docs/OAuth2Api.md#patchoauth2client) | **PATCH** /admin/clients/{id} | Patch OAuth 2.0 Client
*OAuth2Api* | [**performOAuth2DeviceVerificationFlow**](docs/OAuth2Api.md#performoauth2deviceverificationflow) | **GET** /oauth2/device/verify | OAuth 2.0 Device Verification Endpoint
*OAuth2Api* | [**rejectOAuth2ConsentRequest**](docs/OAuth2Api.md#rejectoauth2consentrequest) | **PUT** /admin/oauth2/auth/requests/consent/reject | Reject OAuth 2.0 Consent Request
*OAuth2Api* | [**rejectOAuth2LoginRequest**](docs/OAuth2Api.md#rejectoauth2loginrequest) | **PUT** /admin/oauth2/auth/requests/login/reject | Reject OAuth 2.0 Login Request
*OAuth2Api* | [**rejectOAuth2LogoutRequest**](docs/OAuth2Api.md#rejectoauth2logoutrequest) | **PUT** /admin/oauth2/auth/requests/logout/reject | Reject OAuth 2.0 Session Logout Request
*OAuth2Api* | [**revokeOAuth2ConsentSessions**](docs/OAuth2Api.md#revokeoauth2consentsessions) | **DELETE** /admin/oauth2/auth/sessions/consent | Revoke OAuth 2.0 Consent Sessions of a Subject
*OAuth2Api* | [**revokeOAuth2LoginSessions**](docs/OAuth2Api.md#revokeoauth2loginsessions) | **DELETE** /admin/oauth2/auth/sessions/login | Revokes OAuth 2.0 Login Sessions by either a Subject or a SessionID
*OAuth2Api* | [**revokeOAuth2Token**](docs/OAuth2Api.md#revokeoauth2token) | **POST** /oauth2/revoke | Revoke OAuth 2.0 Access or Refresh Token
*OAuth2Api* | [**setOAuth2Client**](docs/OAuth2Api.md#setoauth2client) | **PUT** /admin/clients/{id} | Set OAuth 2.0 Client
*OAuth2Api* | [**setOAuth2ClientLifespans**](docs/OAuth2Api.md#setoauth2clientlifespans) | **PUT** /admin/clients/{id}/lifespans | Set OAuth2 Client Token Lifespans
*OAuth2Api* | [**trustOAuth2JwtGrantIssuer**](docs/OAuth2Api.md#trustoauth2jwtgrantissuer) | **POST** /admin/trust/grants/jwt-bearer/issuers | Trust OAuth2 JWT Bearer Grant Type Issuer
*OidcApi* | [**createOidcDynamicClient**](docs/OidcApi.md#createoidcdynamicclient) | **POST** /oauth2/register | Register OAuth2 Client using OpenID Dynamic Client Registration
*OidcApi* | [**createVerifiableCredential**](docs/OidcApi.md#createverifiablecredential) | **POST** /credentials | Issues a Verifiable Credential
*OidcApi* | [**deleteOidcDynamicClient**](docs/OidcApi.md#deleteoidcdynamicclient) | **DELETE** /oauth2/register/{id} | Delete OAuth 2.0 Client using the OpenID Dynamic Client Registration Management Protocol
*OidcApi* | [**discoverOidcConfiguration**](docs/OidcApi.md#discoveroidcconfiguration) | **GET** /.well-known/openid-configuration | OpenID Connect Discovery
*OidcApi* | [**getOidcDynamicClient**](docs/OidcApi.md#getoidcdynamicclient) | **GET** /oauth2/register/{id} | Get OAuth2 Client using OpenID Dynamic Client Registration
*OidcApi* | [**getOidcUserInfo**](docs/OidcApi.md#getoidcuserinfo) | **GET** /userinfo | OpenID Connect Userinfo
*OidcApi* | [**revokeOidcSession**](docs/OidcApi.md#revokeoidcsession) | **GET** /oauth2/sessions/logout | OpenID Connect Front- and Back-channel Enabled Logout
*OidcApi* | [**setOidcDynamicClient**](docs/OidcApi.md#setoidcdynamicclient) | **PUT** /oauth2/register/{id} | Set OAuth2 Client using OpenID Dynamic Client Registration
*WellknownApi* | [**discoverJsonWebKeys**](docs/WellknownApi.md#discoverjsonwebkeys) | **GET** /.well-known/jwks.json | Discover Well-Known JSON Web Keys


### Models

- [AcceptDeviceUserCodeRequest](docs/AcceptDeviceUserCodeRequest.md)
- [AcceptOAuth2ConsentRequest](docs/AcceptOAuth2ConsentRequest.md)
- [AcceptOAuth2ConsentRequestSession](docs/AcceptOAuth2ConsentRequestSession.md)
- [AcceptOAuth2LoginRequest](docs/AcceptOAuth2LoginRequest.md)
- [CreateJsonWebKeySet](docs/CreateJsonWebKeySet.md)
- [CreateVerifiableCredentialRequestBody](docs/CreateVerifiableCredentialRequestBody.md)
- [CredentialSupportedDraft00](docs/CredentialSupportedDraft00.md)
- [DeviceAuthorization](docs/DeviceAuthorization.md)
- [DeviceUserAuthRequest](docs/DeviceUserAuthRequest.md)
- [ErrorOAuth2](docs/ErrorOAuth2.md)
- [GenericError](docs/GenericError.md)
- [GetVersion200Response](docs/GetVersion200Response.md)
- [HealthNotReadyStatus](docs/HealthNotReadyStatus.md)
- [HealthStatus](docs/HealthStatus.md)
- [IntrospectedOAuth2Token](docs/IntrospectedOAuth2Token.md)
- [IsReady200Response](docs/IsReady200Response.md)
- [IsReady503Response](docs/IsReady503Response.md)
- [JsonPatch](docs/JsonPatch.md)
- [JsonWebKey](docs/JsonWebKey.md)
- [JsonWebKeySet](docs/JsonWebKeySet.md)
- [KeysetPaginationRequestParameters](docs/KeysetPaginationRequestParameters.md)
- [KeysetPaginationResponseHeaders](docs/KeysetPaginationResponseHeaders.md)
- [OAuth2Client](docs/OAuth2Client.md)
- [OAuth2ClientTokenLifespans](docs/OAuth2ClientTokenLifespans.md)
- [OAuth2ConsentRequest](docs/OAuth2ConsentRequest.md)
- [OAuth2ConsentRequestOpenIDConnectContext](docs/OAuth2ConsentRequestOpenIDConnectContext.md)
- [OAuth2ConsentSession](docs/OAuth2ConsentSession.md)
- [OAuth2LoginRequest](docs/OAuth2LoginRequest.md)
- [OAuth2LogoutRequest](docs/OAuth2LogoutRequest.md)
- [OAuth2RedirectTo](docs/OAuth2RedirectTo.md)
- [OAuth2TokenExchange](docs/OAuth2TokenExchange.md)
- [OidcConfiguration](docs/OidcConfiguration.md)
- [OidcUserInfo](docs/OidcUserInfo.md)
- [RFC6749ErrorJson](docs/RFC6749ErrorJson.md)
- [RejectOAuth2Request](docs/RejectOAuth2Request.md)
- [TokenPagination](docs/TokenPagination.md)
- [TokenPaginationHeaders](docs/TokenPaginationHeaders.md)
- [TokenPaginationRequestParameters](docs/TokenPaginationRequestParameters.md)
- [TokenPaginationResponseHeaders](docs/TokenPaginationResponseHeaders.md)
- [TrustOAuth2JwtGrantIssuer](docs/TrustOAuth2JwtGrantIssuer.md)
- [TrustedOAuth2JwtGrantIssuer](docs/TrustedOAuth2JwtGrantIssuer.md)
- [TrustedOAuth2JwtGrantJsonWebKey](docs/TrustedOAuth2JwtGrantJsonWebKey.md)
- [VerifiableCredentialPrimingResponse](docs/VerifiableCredentialPrimingResponse.md)
- [VerifiableCredentialProof](docs/VerifiableCredentialProof.md)
- [VerifiableCredentialResponse](docs/VerifiableCredentialResponse.md)
- [VerifyUserCodeRequest](docs/VerifyUserCodeRequest.md)
- [Version](docs/Version.md)

### Authorization


Authentication schemes defined for the API:
<a id="basic"></a>
#### basic


- **Type**: HTTP basic authentication
<a id="bearer"></a>
#### bearer


- **Type**: HTTP Bearer Token authentication
<a id="oauth2-accessCode"></a>
#### oauth2 accessCode


- **Type**: OAuth
- **Flow**: accessCode
- **Authorization URL**: https://hydra.demo.ory.sh/oauth2/auth
- **Scopes**: 
  - `offline`: A scope required when requesting refresh tokens (alias for &#x60;offline_access&#x60;)
  - `offline_access`: A scope required when requesting refresh tokens
  - `openid`: Request an OpenID Connect ID Token

## About

This TypeScript SDK client supports the [Fetch API](https://fetch.spec.whatwg.org/)
and is automatically generated by the
[OpenAPI Generator](https://openapi-generator.tech) project:

- API version: `v26.2.0`
- Package version: `v26.2.0`
- Generator version: `7.17.0`
- Build package: `org.openapitools.codegen.languages.TypeScriptFetchClientCodegen`

The generated npm module supports the following:

- Environments
  * Node.js
  * Webpack
  * Browserify
- Language levels
  * ES5 - you must have a Promises/A+ library installed
  * ES6
- Module systems
  * CommonJS
  * ES6 module system


## Development

### Building

To build the TypeScript source code, you need to have Node.js and npm installed.
After cloning the repository, navigate to the project directory and run:

```bash
npm install
npm run build
```

### Publishing

Once you've built the package, you can publish it to npm:

```bash
npm publish
```

## License

[Apache 2.0]()