2.1.3 ⢠Published 2 years ago
chipp v2.1.3
š³ Chipp.ai
ā” Building the pay-per-generation monetization platform for AI applications ā”
Be sure to sign up for an account and complete Stripe onboarding at https://app.chipp.ai
Installation
npm i chipp
Usage
import Chipp from "chipp";
const chipp = new Chipp({
apiKey: "your-api-key-from-Chipp-dashboard",
});
// userId needs to come from your database or auth session
let user = await chipp.getUser({ userId: "a-unique-identifier-for-user" });
// If the user is null, the user does not exist in the Chipp system and needs to be created
if (!user) {
user = await chipp.createUser({ userId: "a-unique-identifier-for-user" });
}
// Get the number of credits remaining for this user
const numChipps = await user.getCredits();
// Deduct credits from this user
await user.deductCredits(1);
// Generate a payment URL where this user can choose their preferred pakcages of credits and buy more.
// Pass in a redirect URL to bring your user back to your app after the user payment succeeds
const url = await user.getPackagesURL({
returnToUrl: "https://your-app.com/wherever-user-was",
});
2.1.3
2 years ago
2.1.2
2 years ago
2.1.0
2 years ago
2.0.12
2 years ago
2.0.11
2 years ago
2.0.10
2 years ago
2.0.9
2 years ago
2.0.8
2 years ago
2.0.7
2 years ago
2.0.6
2 years ago
2.0.5
2 years ago
2.0.4
2 years ago
2.0.3
2 years ago
2.0.2
2 years ago
2.0.1
2 years ago
2.0.0
2 years ago
0.3.12
2 years ago
0.3.11
2 years ago
0.3.10
2 years ago
0.3.9
2 years ago
0.3.8
2 years ago
0.3.7
2 years ago
0.3.6
2 years ago
0.3.5
2 years ago
0.3.4
2 years ago
0.3.3
2 years ago
0.3.2
2 years ago
0.3.1
2 years ago
0.3.0
2 years ago
0.2.0
2 years ago
0.1.10
2 years ago
0.1.9
2 years ago
0.1.8
2 years ago
0.1.7
2 years ago
0.1.6
2 years ago
0.1.5
2 years ago
0.1.4
2 years ago
0.1.3
2 years ago
0.1.2
2 years ago