
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
wedge-pay-web
Advanced tools
A simple vanilla TypeScript SDK for hosting web applications with callback support. This SDK provides a modal interface that can communicate with embedded web applications through postMessage events.
npm install wedge-pay-web
import { WedgePaySDK } from 'wedge-pay-web';
const sdk = new WedgePaySDK({
token: 'your-onboarding-token',
env: 'sandbox',
type: 'onboarding',
onEvent: (event) => {
console.log('Event:', event);
},
onSuccess: (customerId) => {
console.log('Success:', customerId);
},
onClose: (reason) => {
console.log('Closed:', reason);
},
onError: (error) => {
console.error('Error:', error);
},
onLoad: (url) => {
console.log('Loaded:', url);
},
});
// Open the modal
sdk.open();
token: Your onboarding token (string)env: Environment to use - 'sandbox' or 'production'type: Flow type - 'onboarding' or 'funding'All callbacks are required and must be provided:
onSuccess: Triggered when webapp sends onSuccess event with customer IDonError: Triggered when webapp sends onError event or loading fails (auto-calls onClose)onClose: Triggered when webapp sends onClose event or user cancelsonEvent: Triggered when webapp sends onEvent event for general eventsonLoad: Triggered when webapp finishes loading (sends iOSReady to webapp)The SDK automatically constructs URLs based on your environment:
https://onboarding-sandbox.wedge-can.comhttps://onboarding-production.wedge-can.com// Onboarding flow
const sdk = new WedgePaySDK({
token: 'abc123',
env: 'sandbox',
type: 'onboarding',
// ... callbacks
});
// Funding flow
const sdk = new WedgePaySDK({
token: 'abc123',
env: 'sandbox',
type: 'funding',
// ... callbacks
});
// Production environment
const sdk = new WedgePaySDK({
token: 'prod-token-123',
env: 'production',
type: 'onboarding',
// ... callbacks
});
Your webapp should send messages to the parent window using postMessage. The SDK supports multiple message formats:
// Success event
window.parent.postMessage({
event: 'onSuccess', // or type: 'SUCCESS'
data: 'customer-123'
}, '*');
// Error event
window.parent.postMessage({
event: 'onError', // or type: 'ERROR'
data: { message: 'Something went wrong' }
}, '*');
// Close event
window.parent.postMessage({
event: 'onClose', // or type: 'EXIT' or type: 'CLOSE'
data: 'user_cancelled'
}, '*');
// General event
window.parent.postMessage({
event: 'onEvent', // or type: 'EVENT'
data: { type: 'progress', step: 2 }
}, '*');
// Success event
window.parent.postMessage({
onSuccess: 'customer-123'
}, '*');
// Error event
window.parent.postMessage({
onError: { message: 'Something went wrong' }
}, '*');
// Close event
window.parent.postMessage({
onClose: 'user_cancelled'
}, '*');
// General event
window.parent.postMessage({
onEvent: { type: 'progress', step: 2 }
}, '*');
// Simple string messages
window.parent.postMessage('onClose', '*');
window.parent.postMessage('onSuccess', '*');
new WedgePaySDK(config: WedgePaySDKConfig)
open(): Opens the modal and loads the webappclose(reason?: any): Closes the modal with optional reasongetIsOpen(): Returns current open stateinterface WedgePaySDKConfig {
token: string;
env: 'sandbox' | 'production';
type: 'onboarding' | 'funding';
onSuccess: (customerId: string) => void;
onError: (error: any) => void;
onClose: (reason: any) => void;
onEvent: (event: any) => void;
onLoad: (url: string) => void;
}
See examples/react-example.tsx for a complete React implementation.
See examples/vanilla-example.html for a vanilla JavaScript implementation.
# Install dependencies
npm install
# Build the SDK
npm run build
# Watch mode for development
npm run dev
# Clean build directory
npm run clean
MIT
FAQs
Web SDK for hosting web applications with callback support
We found that wedge-pay-web demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.