@refoldai/refold-js
v10.0.0
Published
Refold frontend SDK
Maintainers
Readme
Refold Javascript SDK
Refold frontend SDK.
Install
npm
npm install @refoldai/refold-jsyarn
yarn add @refoldai/refold-jsUsage
Include
Browser
<!-- use this if you get an error saying `exports` is not defined. -->
<script>var exports = {};</script>
<!-- use a specific version -->
<script src="https://cdn.jsdelivr.net/npm/@refoldai/[email protected]"></script>
<!-- use a version range instead of a specific version -->
<script src="https://cdn.jsdelivr.net/npm/@refoldai/refold-js@10"></script>
<script src="https://cdn.jsdelivr.net/npm/@refoldai/[email protected]"></script>
<!-- omit the version completely to use the latest one -->
<!-- you should NOT use this in production -->
<script src="https://cdn.jsdelivr.net/npm/@refoldai/refold-js"></script>Node
import { Refold } from "@refoldai/refold-js";
// or, if you're using CommonJS
const { Refold } = require("@refoldai/refold-js");Initialize
// initialize with token
const refold = new Refold({
// the token you generate for linked accounts using the Refold backend SDK
token: "REFOLD_SESSION_TOKEN",
// OPTIONAL: set custom base url for all API requests. only useful if you are hosting Refold on premise.
baseUrl: "https://refold.example.com/backend",
});
// Or, initialize without token
const refold = new Refold();
// and you can set the token later.
refold.token = "REFOLD_SESSION_TOKEN";Documentation
You can read the SDK documentation here.
This documentation is also available in llms.txt format, which is a simple markdown standard that LLMs can consume easily.
