2.1.3 ā¢ Published 6 months 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
6 months ago
2.1.2
6 months ago
2.1.0
6 months ago
2.0.12
6 months ago
2.0.11
7 months ago
2.0.10
7 months ago
2.0.9
8 months ago
2.0.8
8 months ago
2.0.7
8 months ago
2.0.6
8 months ago
2.0.5
8 months ago
2.0.4
8 months ago
2.0.3
8 months ago
2.0.2
8 months ago
2.0.1
8 months ago
2.0.0
8 months ago
0.3.12
8 months ago
0.3.11
8 months ago
0.3.10
8 months ago
0.3.9
8 months ago
0.3.8
8 months ago
0.3.7
8 months ago
0.3.6
8 months ago
0.3.5
8 months ago
0.3.4
8 months ago
0.3.3
8 months ago
0.3.2
8 months ago
0.3.1
8 months ago
0.3.0
8 months ago
0.2.0
8 months ago
0.1.10
9 months ago
0.1.9
9 months ago
0.1.8
9 months ago
0.1.7
9 months ago
0.1.6
9 months ago
0.1.5
9 months ago
0.1.4
9 months ago
0.1.3
9 months ago
0.1.2
9 months ago