Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up examples #2205

Merged
merged 9 commits into from
Oct 9, 2024
21 changes: 21 additions & 0 deletions examples/snippets/example_template.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* example_template.py - This is a template for defining new examples. It is not intended to be used directly.

* <describe what this example does>

* In this example, we:
* - <key step 1>
* - <key step 2
* - ...

* <describe assumptions about the user's stripe account, environment, or configuration;
* or things to watch out for when running>
*/

import {Stripe} from 'stripe';

const apiKey = '{{API_KEY}}';

console.log('Hello World');
// const client = new Stripe(apiKey);
// client.v2....
12 changes: 12 additions & 0 deletions examples/snippets/meter_event_stream.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
/**
* meter_event_stream.ts - Use the high-throughput meter event stream to report create billing meter events.
*
* In this example, we:
* - create a meter event session and store the session's authentication token
* - define an event with a payload
* - use the meterEventStream service to create an event stream that reports this event
*
* This example expects a billing meter with an event_name of 'alpaca_ai_tokens'. If you have
* a different meter event name, you can change it before running this example.
*/

import {Stripe} from 'stripe';

const apiKey = '{{API_KEY}}';
Expand Down
7 changes: 0 additions & 7 deletions examples/snippets/new_example.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
/**
* thinevent_webhook_handler.js - receive and process thin events like the
* v1.billing.meter.error_report_triggered event.
* In this example, we:
* - create a Stripe client object called client
* - use client.parseThinEvent to parse the received thin event webhook body
* - call client.v2.core.events.retrieve to retrieve the full event object
* - if it is a v1.billing.meter.error_report_triggered event type, call
* event.fetchRelatedObject to retrieve the Billing Meter object associated
* with the event.
*/

const express = require('express');
const {Stripe} = require('stripe');

Expand Down
Loading