npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@socian/socian-auth-node-sdk

v1.8.0

Published

Socian Authentication Server SDK.

Downloads

10

Readme

Socian Auth Server - SDK - Node

npm install npm run build

Installation

npm i @socian/socian-auth-node-sdk

or

yarn add @socian/socian-auth-node-sdk

Examples

// Sign In Example
import SocianAuthSDKClient from '@socian/socian-auth-node-sdk';

class MyClass {
	async runSignIn() {
		const authClientConfig = {
			"app_id": "socian-consumerbuzz-client_app_id_E3WDTFR77ZD7Q0J7",
			"app_secret": "socian-consumerbuzz-client_app_id_OMRHHVTAOD6A3EUG",
		}

		const authClient =   new SocianAuthSDKClient(authClientConfig)

		const credentials = {
			"email": "[email protected]",
			"password": "password"
		}

		await authClient.signIn("credential", credentials)
		const authUser = await authClient.fetchUser()

		console.log('##### Socian Auth Server - SignIn Response #####')

		console.log({
			'intentId': authClient.getIntentId(),
			'intentObject': authClient.getIntentObject(),
			'loggedIn': authClient.getLoggedIn(),
			'authUser': authUser
		})

		if(authClient.getLoggedIn()){
			console.log("You are signed in - ", authUser?.name)
		}else{
			console.log("Sign In Failed - ", authUser?.name)
		}
	}
}

(new MyClass).runSignIn()
// Sign Up Example

import SocianAuthSDKClient from '@socian/socian-auth-node-sdk';

class MyClass {
	// ...
    
	async runSignUp() {
		try{
			const authClientConfig = {
				"app_id": "socian-consumerbuzz-client_app_id_E3WDTFR77ZD7Q0J7",
				"app_secret": "socian-consumerbuzz-client_app_id_OMRHHVTAOD6A3EUG",
			}

			const authClient =   new SocianAuthSDKClient(authClientConfig)

			const randomId = this.generateId(1, 500)
			const newUserFormData = {
				"name": `AUTH SDK USER - ${randomId}`,
				"email": `auth-skd-user-${randomId}@socian.ai`,
				"password": "password"
			}

			await authClient.signUp("credential", newUserFormData)
			const newUserData = authClient.getNewUser()

			console.log('##### Socian Auth Server - Sign Up Response #####')

			console.log({
				'intentId': authClient.getIntentId(),
				'authUserEmail': newUserData?.email,
				'newUserData': newUserData
			})

			if(authClient.getNewUser()){
				console.log("Your account has been created - ", newUserData?.name)
			}else{
				console.log("Sign Up Failed.")
			}
		}catch(error) {
			console.error('Sign up Error:')
			console.error(error)
		}
	}

	generateId(min, max) {
		return Math.floor(Math.random() * (max - min + 1)) + min;
	}
}

(new MyClass).runSignUp()