Hi <@U03DJ6Q0EUE> <@U011D3UQKNY> told me you'd be ...
# talk-keto
f
Hi @narrow-van-43826 @magnificent-energy-493 told me you'd be the best person to ping regarding typescript SDK usage. even though the type system is now working correctly with the package i'm struggling to understand how to implement it properly, and can't find any documentation/tests with a crude example i was hoping you might be able to send me a quick example where the package/required clients are initialised and a basic check request is made. just as simple as 10 loc is fine and would be super useful
n
Hi, for the REST API you can use https://www.npmjs.com/package/@ory/keto-client. Then a simple example would be:
Copy code
keto
        .readApi(slug)
        .getRelationTuples()
        .then(({ data }) => data)
        .catch(catcher),
And
keto
is
Copy code
export const keto = {
  readApi: (slug: string) =>
    new KetoReadApi(
      new ClientConfig({
        basePath: <SDK configuration from console>,
      }),
      '',
      axios
    ),
  writeApi: (slug: string) =>
    new KetoWriteApi(
      new ClientConfig({
        basePath: <SDK configuration from console>,
      }),
      '',
      axios
    )
}