Skip to content

Commit d21cdd1

Browse files
authored
fix(example): expires_at is in milliseconds (#2389)
I didn't find any place where it's referenced that expires_at is in seconds.
1 parent f3f81f1 commit d21cdd1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/snippets/meter_event_stream.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ let meterEventSession: null | any = null;
2020
async function refreshMeterEventSession() {
2121
if (
2222
meterEventSession === null ||
23-
new Date(meterEventSession.expires_at * 1000) <= new Date()
23+
new Date(meterEventSession.expires_at) <= new Date()
2424
) {
2525
// Create a new meter event session in case the existing session expired
2626
const client = new Stripe(apiKey);

0 commit comments

Comments
 (0)