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

@allganize/sdk

v0.10.214

Published

Alli JavaScript SDK

Downloads

335

Readme

@alli/sdk

Pre-requisites

Node

There are many ways to install Node, but nvm is recommended. Make sure the version is 20 (as of Jan 26, 2024), or whatever matches the latest AWS node runtime version.

Install Dependencies

# npm
$ npm install

# or yarn
$ yarn install

Configs

If you wish to change configuration options, see src/config.ts file. It uses penv.macro to set each options according to your STAGE environment variable. If the value is not specified for the given STAGE variable, it will default to the second argument. If you're developing locally, your STAGE variable is most likely not included here. I recommend either adding your stage key-value pair or changing the default value. For example,

  graphqlUri: env(
    {
      production: 'if STAGE is equal to production, this value is used',
      // key value pairs for other stages
      // ...
      yourstagename: 'will use this value if specified',
    },
    'this is the default value',
  ),

If you change the default value, DO NOT COMMIT this change unless you know what you're doing.

Local Development

# npm
$ npm run dev

# or yarn
$ yarn dev

Deploy

STEP.1 see ckeck-list document

https://github.com/allganize/mally/wiki/SDK-deployment-check-list

STEP.2 s3 upload & invalidate

You must specify RELEASE as a variable. If the release is a valid semantic version, the javascript assets will also be uploaded to latest, major, minor folders in S3. For example, if you release a version 1.2.3, all compiled assets are uploaded to 1.2.3 folder. Javascript assets are uploaded to the following folders.

  • latest
  • 1
  • 1.2 So be careful when you are uploading versions that are valid semantic version and yet lower than the actual latest uploaded version.
# npm
$ RELEASE=0.9.59 npm run deploy:staging
or
$ RELEASE=0.9.59 npm run deploy:production

# or yarn
$ RELEASE=0.9.59 yarn deploy:staging
or
$ RELEASE=0.9.59 yarn deploy:production

For non-production environment, the url is https://dev-sdk.alli.ai/(STAGE)/(RELEASE)/alli.js For production environment, the url is https://sdk.alli.ai/(RELEASE)/alli.js.

after deployment you need to flush cache on cloudfront

./bin/invalidate-cdn-staging.sh 0.9.59

STEP.3 npm publish

🔥 This can not be reversed. Please do enough testing and proceed. 🔥 You should have npm token to publish. If you don't, you can make on npmjs with our common account(allganizedev)

Versioning should be done after deployment.

yarn version

Before you publish you should read this npm Unpublish Policy. And then publish to npm registry.

yarn publish

You can also use this URL (https://unpkg.com/@allganize/sdk) for production.

STEP.4 update document

Alli dashboard displays latest SDK version infos in project settings. You can update this information after deployment as follows.

curl -H "api-key:ZYtuyBiG7oki4X5AWiaK" -d ' {"sdk":"web", "latestVersion":"0.9.59"} ' https://backend.alli.ai/private/update_sdk_version

The endpoint is https://staging-backend.alli.ai/private/update_sdk_version for staging environment. The sdk parameter can be one of the following values: android, ios, web.

🔥 MAKE SURE THE RELEASE IS SET CORRECTLY SO IT DOES NOT OVERWRITE EXISTING FILES. 🔥