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

@useorbital/client-sdk

v1.12.0

Published

SDK for in-app user interview recruitment via orbital

Downloads

199

Readme

Orbital SDK

This package enables in-app recruitment for your discoveries via Orbital

Documentation

You can find the SDK documentation in the Orbital Docs

Usage Examples

In order to initialize the Orbital SDK you'll need to provide your Space ID. You can find your specific Space ID within Orbital under Settings > Installation

Javascript / Typescript

import orbital from '@useorbital/client-sdk'

const orbitalSdk = await orbital('your-space-id')

React

import orbital, { OrbitalSdk } from '@useorbtial/client-sdk'
import { createContext, useContext, useState, useEffect, PropsWithChildren } from 'react'

const OrbitalContext = createContext<OrbitalSdk | undefined>(undefined)

function OrbitalProvider({ children, spaceId }: PropsWithChildren<{ spaceId: string }>) {
    const [sdk, setSdk] = useState<OrbitalSdk | undefined>(undefined)

    useEffect(() => {
        orbital(spaceId).then(setSdk)
    }, [spaceId])

    return (
      <OrbitalContext.Provider value={sdk} >
          {children}
      </OrbitalContext.Provider>
    )
}

function useOrbital(): OrbitalSdk | undefined {
    return useContext(OrbitalContext)
}

React with SSR

The Orbital SDK requires access to the window object on import. If server side rendering (SSR) is used this is usually only possible on the client. If you are using, you'll need to make sure to only import the Orbital SDK in client code.

import { OrbitalSdk } from '@useorbtial/client-sdk'
import { createContext, useContext, useState, useEffect, PropsWithChildren } from 'react'

const OrbitalContext = createContext<OrbitalSdk | undefined>(undefined)

function OrbitalProvider({ children, spaceId }: PropsWithChildren<{ spaceId: string }>) {
    const [sdk, setSdk] = useState<OrbitalSdk | undefined>(undefined)

    useEffect(() => {
        import('@useorbtial/client-sdk')
          .then(({ default: orbital }) => orbital(spaceId))
          .then(setSdk)
    }, [spaceId])

    return (
      <OrbitalContext.Provider value={sdk} >
          {children}
      </OrbitalContext.Provider>
    )
}

function useOrbital(): OrbitalSdk | undefined {
    return useContext(OrbitalContext)
}

Changelog

1.12.0 (2024-11-04)

Features

  • sdk: add support for dom content conditions (#503) 5f06e67

1.11.0 (2024-11-04)

Features

  • api: add dom content location trigger (#501) 0b6631d
  • ui: redux rewrite (#435) d52c2d7

Bug Fixes

  • sdk: read correct env variables for version increments (#479) deaac58

1.9.0 (2024-10-17)

Features

  • sdk: support research panel trigger (#415) 60a2e82

1.8.0 (2024-09-10)

Features

  • client-ui: apply session cooldown locally on scheduling (#417) 2176674

1.7.0 (2024-08-19)

Features

  • multiple: remove references to external_id from ui and sdk types (#391) 9ccd1f3

1.6.2 (2024-08-14)

1.6.1 (2024-08-12)

1.6.0 (2024-08-09)

Features

  • sdk: add support for discovery triggers v2 (#354) 8851d09

1.5.0 (2024-06-26)

Features

  • demo: replace demo ui with solid background (#278) c6efb82

1.4.1 (2024-06-20)

Bug Fixes

  • sdk: simplify trigger detection for interaction triggers (#267) df8f815

1.4.0 (2024-05-23)

Features

  • ui: intercept v2 (#221) aa4a649

1.3.0 (2024-05-03)

Features

  • client: support arbitrary identity types (#186) 3eacb4f, closes useorbital/orbital-api#230

1.2.1 (2024-04-26)

1.2.0 (2024-04-11)

Features

  • sdk: support extended path matching for discoveries (#190) 79df588

1.1.1 (2024-04-04)

1.1.0 (2024-03-12)

Features

  • client-sdk: use the correct default client origin url and provide sdk version to client (#157) 8492219

1.0.0 (2024-02-01)

⚠ BREAKING CHANGES

  • sdk: initial release (#130)

Features

  • sdk: initial release (#130) 1130f6a