Socket
Socket
Sign inDemoInstall

stytch

Package Overview
Dependencies
Maintainers
8
Versions
157
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stytch - npm Package Compare versions

Comparing version 3.0.0-beta.1 to 3.0.0-beta.2

31

dist/otps.js

@@ -42,2 +42,32 @@ "use strict";

class WhatsApp {
constructor(client, base_path) {
_defineProperty(this, "delivery", "whatsapp");
this.client = client;
this.base_path = base_path;
}
endpoint(path) {
return `${this.base_path}/${this.delivery}/${path}`;
}
send(data) {
return (0, _shared.request)(this.client, {
method: "POST",
url: this.endpoint("send"),
data
});
}
loginOrCreate(data) {
return (0, _shared.request)(this.client, {
method: "POST",
url: this.endpoint("login_or_create"),
data
});
}
}
class OTPs {

@@ -49,2 +79,3 @@ constructor(client) {

this.sms = new SMS(client, this.base_path);
this.whatsapp = new WhatsApp(client, this.base_path);
}

@@ -51,0 +82,0 @@

2

package.json
{
"name": "stytch",
"version": "3.0.0-beta.1",
"version": "3.0.0-beta.2",
"description": "A wrapper for the Stytch API",

@@ -5,0 +5,0 @@ "types": "./types/lib/index.d.ts",

@@ -23,2 +23,22 @@ import type { AxiosInstance } from "axios";

}
export interface OTPWhatsAppSendRequest {
phone_number: string;
expiration_minutes?: bigint;
attributes?: Attributes;
}
export interface OTPWhatsAppSendResponse extends BaseResponse {
user_id: string;
phone_id: string;
}
export interface OTPWhatsAppLoginOrCreateRequest {
phone_number: string;
expiration_minutes?: bigint;
attributes?: Attributes;
create_user_as_pending?: boolean;
}
export interface OTPWhatsAppLoginOrCreateResponse extends BaseResponse {
user_id: string;
phone_id: string;
user_created: boolean;
}
export interface AuthenticateRequest {

@@ -46,5 +66,15 @@ method_id: string;

}
declare class WhatsApp {
base_path: string;
delivery: string;
private client;
constructor(client: AxiosInstance, base_path: string);
private endpoint;
send(data: OTPWhatsAppSendRequest): Promise<OTPWhatsAppSendResponse>;
loginOrCreate(data: OTPWhatsAppLoginOrCreateRequest): Promise<OTPWhatsAppLoginOrCreateResponse>;
}
export declare class OTPs {
base_path: string;
sms: SMS;
whatsapp: WhatsApp;
private client;

@@ -51,0 +81,0 @@ constructor(client: AxiosInstance);

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