---
updatedAt: 2026-05-25T02:04:03.000Z
agentTools:
  projectIndex: https://checkout-docs.transfi.com/llms.txt
---

#  Authentication

Both SDKs use **HMAC-based authentication** built in automatically — you only need to pass your keys when initializing the client.

```javascript Node.js
const { TransFiPaymentAPI } = require("transfi-checkout");

const client = new TransFiPaymentAPI({
  publicKey: process.env.TRANSFI_PUBLIC_KEY,
  secretKey: process.env.TRANSFI_SECRET_KEY,
});
```
```python
from transfi import TransFiPaymentAPI

api = TransFiPaymentAPI(
    public_key="YOUR_PUBLIC_KEY",
    secret_key="YOUR_SECRET_KEY",
)
```
```java
sdkConfig config = new sdkConfig("YOUR_PUBLIC_KEY", "YOUR_SECRET_KEY");
transfiPaymentApi api = new transfiPaymentApi(config);
```
```php
use TransFi\TransFiPaymentAPI;
use TransFi\TransFiError;
use TransFi\PaymentInvoiceRequest;
use TransFi\Individual;
use TransFi\ProductDetails;

$api = new TransFiPaymentAPI([
    'publicKey' => 'YOUR_PUBLIC_KEY',
    'secretKey' => 'YOUR_SECRET_KEY',
]);

```

| Parameter                  | Type   | Required | Description                 |
| :------------------------- | :----- | :------- | :-------------------------- |
| `publicKey` / `public_key` | string | Yes      | Your TransFi API public key |
| `secretKey` / `secret_key` | string | Yes      | Your TransFi API secret key |

<br />