Skip to content

Commit

Permalink
fix: update examples to use correct cookie name and add execution code
Browse files Browse the repository at this point in the history
  • Loading branch information
mherod committed Jan 4, 2025
1 parent a1421d4 commit aa6f288
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
9 changes: 7 additions & 2 deletions examples/advanced-usage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export async function browserSpecificExamples(): Promise<void> {

// Get a cookie by name and domain
const cookie = await getCookieFn({
name: "session",
name: "user_session",
domain: "github.com",
});

Expand All @@ -59,9 +59,14 @@ export async function urlBasedExamples(): Promise<void> {

// Get a cookie by name and domain
const cookie = await getCookieFn({
name: "session",
name: "user_session",
domain: "github.com",
});

console.log("Cookie:", cookie);
}

// Execute the examples
Promise.all([browserSpecificExamples(), urlBasedExamples()]).catch(
console.error,
);
5 changes: 4 additions & 1 deletion examples/basic-usage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@ export async function runBasicExamples(): Promise<void> {

// Get a cookie by name and domain
const cookie = await getCookieFn({
name: "session",
name: "user_session",
domain: "github.com",
});

console.log("Cookie:", cookie);
}

// Execute the examples
runBasicExamples().catch(console.error);

0 comments on commit aa6f288

Please sign in to comment.