Giter VIP home page Giter VIP logo

knock-node's People

Contributors

bceskavich avatar brentjanderson avatar cjbell avatar francoborr avatar juanazam avatar meryldakin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

jspears

knock-node's Issues

feat: support Vercel Edge Runtime

Hey Knock team! Knock's been featured in a few places by Vercel, and my team is leaning heavily on the Vercel Edge Runtime with Next.js, which doesn't support the full Node.js ecosystem. The @knocklabs/node package uses axiom and jsonwebtoken which are not compatible. Can you guys please build in support for the Edge Runtime by switching to the Web Fetch API and jose? Might require some fallbacks for Node.js runtimes before v17, which don't include fetch.

[feature request] get list of active workflows

hello!
would it be possible to expose an endpoint to get a list of active flows in the sdk similar to how the dashboard displays it?
we would like to create our set of tools for non-engineers and want to prevent them from manually typing in workflow ids.

thanks!

[feature request] object.listSubscriptions return total item count

hello!
We would like to get a count of total records for each subscription list, the use is to preview how many users will be impacted if we decided to send a specific notification. PageInfo type does not include a total count but this information is available in dashboard UI subscription list

Thanks!

set object optional properties?

Hello! I'm trying to set an object like this

    const setObjectResult = await knock.objects.set(
      collection,
      id,
      metadata
    );

per documentation here https://docs.knock.app/reference#set-object
where metadata is an optional object, however i'm getting a typescript error

Argument of type 'Object | undefined' is not assignable to parameter of type 'SetObjectProperties'.
  Type 'undefined' is not assignable to type 'SetObjectProperties'.ts(2345)
(parameter) metadata: Object | undefined

is this intentional? should i pass in an empty object instead of undefined?

edit: my goal is to create a new object that identify a group of users to send in-app notification to, assuming the steps are: 1) create object, 2)add users to subscriptions, 3) trigger workflow by sending in subscription group (object?) id

[feature request] get monthly quota

hello!
would it be possible to see how many notifications we have used this month (this is currently visible in our billing dashboard?)
Screenshot 2023-05-09 at 12 42 10 PM

we would like to track usage with our internal tools

Thanks!

verifying signing key

hi all! i'm trying to test enhanced security code before going to prod, following instructions found here https://github.com/knocklabs/knock-node#signing-jwts

on the client app in react

    <KnockFeedProvider
      apiKey={apiKey}
      feedId={feedId}
      userId={walletAddress}
      userToken={authToken}
    >
      <>
        <NotificationIconButton
          ref={notifButtonRef}
          onClick={() => setIsVisible(!isVisible)}
        />
        <NotificationFeedPopover
          buttonRef={notifButtonRef}
          isVisible={isVisible}
          onClose={() => setIsVisible(false)}
        />
      </>
    </KnockFeedProvider>

on the server side this is how i'm signing the jwt

import { Knock } from "@knocklabs/node";
Knock.signUserToken(walletAddress, {
            expiresInSeconds: 10 * 60,
          })

API key starts with pk_test_Ujf and set with NEXT_PUBLIC_KNOCK_PUBLIC_API_KEY env variable, and authToken starts with LS0tLS1CRU and set with KNOCK_SIGNING_KEY env variable, the auth response sends back {"code":"authorization","message":"You are not allowed to access that resource","status":403,"type":"authentication_error"}
I've inspected the request headers which includes the authorization and x-knock-user-token, am I missing a step?
enhanced security mode is turned on for dev environments.

running with

    "@knocklabs/node": "^0.4.17",
    "@knocklabs/react-notification-feed": "^0.8.2", 

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.