Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@gigya-ts/web-sdk

Package Overview
Dependencies
Maintainers
0
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gigya-ts/web-sdk

TypeScript definitions for the Gigya Web SDK

  • 0.1.1
  • npm
  • Socket score

Version published
Weekly downloads
134
decreased by-33.33%
Maintainers
0
Weekly downloads
 
Created
Source

@gigya-ts/web-sdk

Type definitions for interacting with the Gigya / SAP Customer Data Cloud Web SDK.

See @gigya-ts/gigya if you are working with the REST API instead.

Installation

# npm
npm install @gigya-ts/web-sdk

Usage

Define your own schema types. They will be used to type the data used when interacting with the Web SDK.

import { GigyaPreference } from '@gigya-ts/web-sdk';

// Data Schema
type MyDataSchema = {
    myCustomString: string;
    myCustomObject: {
        myCustomNumber: number;
    };
};

// Preferences Schema
type MyPreferencesSchema = {
    terms: {
        myTerms: GigyaPreference;
    };
    myCustomPreference: GigyaPreference;
};

// Subscriptions Schema
type MySubscriptionsSchema = {};

Then, extend the global window with your the Gigya Web SDK, including your schemas:

// gigya.d.ts (or any other name)
import { GigyaWebSDK } from '@gigya-ts/web-sdk';

declare global {
    interface Window {
        onGigyaServiceReady?: () => void;

        gigya?: GigyaWebSDK<MyAccountSchema, MyPreferencesSchema, MySubscriptionsSchema>;
    }
}

Once the global window has been extended, you can use the Web SDK as you normally would:

window.onGigyaServiceReady = () => {
    window.gigya?.accounts.getAccountInfo({
        callback: (response) => {
            console.log('gigya.account.getAccountInfo response', response);
        },
    });
};

FAQs

Package last updated on 01 Aug 2024

Did you know?

Socket

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.

Install

Related posts

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