Skip to main content

SDKs

TypeScript/JavaScript SDK​

Install the SDK and initialize the client once for all the examples using the TypeScript SDK in this documentation:

npm install @credyt/api-client
import { CredytApiClient } from "@credyt/api-client";

const client = new CredytApiClient({ key: "YOUR_API_KEY" });
Secret management

Never hard-code your API key. Store it in an environment variable and read it at runtime:

const client = new CredytApiClient({ key: process.env.CREDYT_API_KEY! });

Use a .env file locally (and add it to .gitignore), and inject the variable through your hosting platform's secrets manager in production.

More TypeScript Examples​

All of the examples in this documentation can also be found in our GitHub repository.

Python SDK​

Install the SDK and initialize the client once for all the examples using the Python SDK in this documentation:

pip install credyt-api
def main():
client = CredytApiClient(
credential=ServiceKeyCredential(key=os.getenv("CREDYT_API_KEY")),
)

response = client.customers.get(
customer_id="cust_4qh0wajx2n9qtazh2tghzkyan2",
)
print(response)


if __name__ == "__main__":
main()
Secret management

Never hard-code your API key. Store it in an environment variable and read it at runtime:

client = CredytApiClient(
credential=ServiceKeyCredential(key=os.getenv("CREDYT_API_KEY")),
)

Use a .env file locally (and add it to .gitignore), and inject the variable through your hosting platform's secrets manager in production.

More Python Examples​

All of the examples in this documentation can also be found in our GitHub repository.