> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rach.finance/llms.txt
> Use this file to discover all available pages before exploring further.

# Source SDKs

> Install the checked-out JavaScript, Python, Go or Dart clients without assuming registry publication.

The source SDKs live under `payments/sdk`. Obtain the matching Payments source checkout from your Rach contact and install its directories. These instructions do not assert that a package is published to npm, PyPI, a Go repository or pub.dev.

## Install

```bash JavaScript / Node theme={null}
npm install /absolute/path/to/payments/sdk/javascript
```

```bash Python theme={null}
python -m pip install /absolute/path/to/payments/sdk/python
```

```bash Go theme={null}
go mod edit -require=github.com/rach-finance/rachfinance-go@v0.0.0
go mod edit -replace=github.com/rach-finance/rachfinance-go=/absolute/path/to/payments/sdk/go/rachfinance
go mod tidy
```

```yaml Dart / Flutter pubspec.yaml theme={null}
dependencies:
  rachfinance:
    path: /absolute/path/to/payments/sdk/flutter
```

The default API origin is `https://api.rach.finance`; SDK paths already include `/api/v1`. Override the base origin only for your trusted test deployment. Keep merchant API keys on your backend. A shipped Flutter app or browser uses a session created by that backend and the public snapshot/widget.

## Create on your backend

```js Node theme={null}
const { RachFinance } = require('rachfinance');
const rach = new RachFinance({ apiKey: process.env.RACH_API_KEY });
const session = await rach.checkout.create({
  amount: '49.95', currency: 'USD', reference: 'order-1001',
  idempotencyKey: 'order-1001-attempt-1',
  callbackURL: 'https://merchant.example/webhooks/rach',
  returnURL: 'https://merchant.example/orders/order-1001',
  embedOrigin: 'https://merchant.example',
});
```

| Client | Exact input | Retry key | Browser return / embedding |
| - | - | - | - |
| JavaScript | `amount: '49.95'` | `idempotencyKey` | `returnURL`, `embedOrigin` |
| Python | `amount='49.95'` | `idempotency_key` | `return_url`, `embed_origin` |
| Go | `CreateCheckoutRequest{AmountExact: "49.95"}` | `IdempotencyKey` | `ReturnURL`, `EmbedOrigin` |
| Dart backend | `amount: '49.95'` | `idempotencyKey` | `returnUrl`, `embedOrigin` |

The Go `AmountExact` input serializes as the wire `amount` string. Legacy numeric inputs remain accepted. Response `amount_exact` is requested; `charged_amount_exact` is actual verified settlement when available. Do not replace either with a binary floating-point value in your accounting records. All clients use POST for `verify-now` and preserve `is_test_mode` returned by the backend.

## Public Flutter snapshot

```dart theme={null}
final client = RachFinance(); // no merchant key in the app
final session = await client.checkout.getSession(sessionId);
final assets = session['available_assets'];
```

Use the [hosted browser widget](https://docs.rach.finance/products/crypto-gateway.md#embedded-checkout) for JavaScript embedding. Server SDKs and the public `sdk.js` widget are different interfaces.

## Activation

| Client | Inspect invitation | Activate |
| - | - | - |
| JavaScript | `auth.inspectActivation(token)` | `auth.activate({token,password,otpCode})` |
| Python | `auth.inspect_activation(token)` | `auth.activate(token=...,password=...,otp_code=...)` |
| Go | `Auth.InspectActivation(ctx,token)` | `Auth.Activate(ctx,token,password,otpCode)` |
| Dart | `auth.inspectActivation(token)` | `auth.activate(token:...,password:...,otpCode:...)` |

Activation does not create a JWT, approve KYC or enable live payments. Existing accounts confirm their current password and TOTP when required. Sign in normally afterward. Public self-registration is disabled.

## Webhook verification

JavaScript exposes `RachFinance.verifyWebhook(rawBody,signature,secret)` for Node.js. Python and Go can use their standard HMAC libraries; [verification examples](https://docs.rach.finance/guides/webhooks.md#verify-the-signature) use the exact raw body and fail closed on malformed signatures.

Verify, durably deduplicate `event_id`, then fulfill in your backend transaction. Do not put a webhook secret into a mobile/browser verifier or treat widget success as financial confirmation.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.