UNPKG

@memori.ai/memori-react

Version:

[![npm version](https://img.shields.io/github/package-json/v/memori-ai/memori-react)](https://www.npmjs.com/package/@memori.ai/memori-react) ![Tests](https://github.com/memori-ai/memori-react/workflows/CI/badge.svg?branch=main) ![TypeScript Support](https

26 lines 792 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getCredits = void 0; const getCredits = async ({ operation = 'session_creation', baseUrl, userID, userName, tenant, }) => { if (!userID && !userName) { throw new Error('Either userID or userName must be provided'); } const resp = await fetch(`${baseUrl}/api/verify-tokens`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ operation, userID, userName, tenant, }), }); if (!resp.ok) { throw new Error('Failed to fetch credits'); } return resp.json(); }; exports.getCredits = getCredits; //# sourceMappingURL=credits.js.map