Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use the api key with the Client object? #19

Open
tomast1337 opened this issue Oct 2, 2023 · 1 comment
Open

How to use the api key with the Client object? #19

tomast1337 opened this issue Oct 2, 2023 · 1 comment

Comments

@tomast1337
Copy link

With the old pagarme-js library, we could do:

import pagarme from "pagarme";
const client = await pagarme.client.connect({ api_key: PAGARME_API_KEY })

However, the new Client object doesn't seem to have an api_key option to use.

@renatoastra
Copy link

renatoastra commented Oct 8, 2023

Hey man, how its going?

Just pass your secret api key on the username and let the password field empty.

Just like that.

import { Client,  } from "@pagarme/pagarme-nodejs-sdk";

const client = new Client({
    basicAuthUserName: 'my-secret-api-key',
    basicAuthPassword: ''
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants