knocklabs / knock-node Goto Github PK
View Code? Open in Web Editor NEWOfficial Node SDK for interacting with the Knock API
License: MIT License
Official Node SDK for interacting with the Knock API
License: MIT License
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
.
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!
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!
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
I am not yet a user of Knock but my team is considering using Knock.
We are concerned about keeping synced the variables in the backend triggering the workflows and the ones used in the message templates.
Do you enforce strongly typed variables in your node client ?
Most CDP like Segment, Rudderstack and other do it with a generated client like this one: https://www.rudderstack.com/docs/features/data-governance/ruddertyper/
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!
Typescript is treating the list endpoint as if it returns a single message โ I'm assuming that instead we expect something closer to the shape at https://docs.knock.app/reference#list-messages?
https://github.com/knocklabs/knock-node/blob/main/src/resources/messages/index.ts#L21
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.