New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

next-stripe-helper

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

next-stripe-helper - npm Package Compare versions

Comparing version 1.1.46 to 1.1.47

11

dist/connect/index.d.ts

@@ -52,2 +52,11 @@ import { Stripe } from 'stripe';

declare const createAccountLink: (options: Stripe.AccountLinkCreateParams) => Promise<Stripe.AccountLink>;
export { createConnectedAccount, createPayout, startOAuthFlow, handleOAuthCallback, createAccountLink };
/**
* Creates a Connect Express login link for a connected account.
*
* @param {string} accountId - The ID of the connected account.
* @param {string} secretKey - Your Stripe secret key.
* @returns {Promise<string>} - A promise that resolves to the created login link URL.
* @throws {Error} - If there's an error during the request.
*/
declare const createConnectExpressLoginLink: (accountId: string, secretKey: string) => Promise<string>;
export { createConnectedAccount, createPayout, startOAuthFlow, handleOAuthCallback, createAccountLink, createConnectExpressLoginLink };
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createAccountLink = exports.handleOAuthCallback = exports.startOAuthFlow = exports.createPayout = exports.createConnectedAccount = void 0;
exports.createConnectExpressLoginLink = exports.createAccountLink = exports.handleOAuthCallback = exports.startOAuthFlow = exports.createPayout = exports.createConnectedAccount = void 0;
const stripe_1 = require("../utils/stripe");

@@ -123,2 +123,31 @@ /**

exports.createAccountLink = createAccountLink;
/**
* Creates a Connect Express login link for a connected account.
*
* @param {string} accountId - The ID of the connected account.
* @param {string} secretKey - Your Stripe secret key.
* @returns {Promise<string>} - A promise that resolves to the created login link URL.
* @throws {Error} - If there's an error during the request.
*/
const createConnectExpressLoginLink = async (accountId, secretKey) => {
const endpoint = `https://api.stripe.com/v1/accounts/${accountId}/login_links`;
try {
const response = await fetch(endpoint, {
method: 'POST',
headers: {
'Authorization': `Bearer ${secretKey}`,
//'Content-Type': 'application/x-www-form-urlencoded'
}
});
if (!response.ok) {
throw new Error(`Failed to create login link: ${response.statusText}`);
}
const data = await response.json();
return data.url;
}
catch (error) {
(0, stripe_1.handleStripeError)(error);
}
};
exports.createConnectExpressLoginLink = createConnectExpressLoginLink;
//# sourceMappingURL=index.js.map

2

package.json
{
"name": "next-stripe-helper",
"version": "1.1.46",
"version": "1.1.47",
"description": "Easily add Stripe boilerplate code to Nextjs, like webhook handling, and subscription updates. This package provides a thin wrapper around the Stripe API, and makes integrating Stripe and NextJS a lot faster!",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/i-dream-of-ai/next-stripe-helper",

@@ -354,2 +354,24 @@ # next-stripe-helper

### Create Connect Express Login Link
Creates a Connect Express login link for a connected account.
```javascript
const loginLinkUrl = await createConnectExpressLoginLink(
'acct_123456789', // Replace with your users connected account ID
'sk_YourStripeSecretKey' // Replace with your Stripe secret key
);
```
Parameters:
- `accountId` (required): The ID of the connected account.
- `secretKey` (required): Your Stripe secret key.
Returns:
- A string representing the created login link URL.
## Subscription Utilities

@@ -356,0 +378,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc