casen
casen
CCConvex Community
Created by casen on 3/2/2024 in #general
Code organization patterns in Convex
I prefer the segregation between commands and queries personally
40 replies
CCConvex Community
Created by casen on 3/2/2024 in #general
Code organization patterns in Convex
Sometimes people make a second request. It’s a messy space.
40 replies
CCConvex Community
Created by casen on 3/2/2024 in #general
Code organization patterns in Convex
Indeed. You send commands, and receive the query over a web hook. In typical MVC we tend to write, and return the result in the same request
40 replies
CCConvex Community
Created by casen on 3/2/2024 in #general
Code organization patterns in Convex
I really love all the sharing about this, thanks!
40 replies
CCConvex Community
Created by casen on 2/28/2024 in #support-community
Issue using crypto functions in http actions to verify slack web hooks
If I feel dedicated, I will muck around and roll my own!
16 replies
CCConvex Community
Created by casen on 2/28/2024 in #support-community
Issue using crypto functions in http actions to verify slack web hooks
They have an interesting approach. I wouldn't say it's my favorite:
import { SlackApp } from "slack-edge";

export const config = {
runtime: "edge",
};

const app = new SlackApp({
env: {
SLACK_SIGNING_SECRET: process.env.SLACK_SIGNING_SECRET!,
SLACK_BOT_TOKEN: process.env.SLACK_BOT_TOKEN!,
SLACK_LOGGING_LEVEL: "DEBUG",
},
});

const req: Request ... // Standard Request object
const result = await app.run(req)
import { SlackApp } from "slack-edge";

export const config = {
runtime: "edge",
};

const app = new SlackApp({
env: {
SLACK_SIGNING_SECRET: process.env.SLACK_SIGNING_SECRET!,
SLACK_BOT_TOKEN: process.env.SLACK_BOT_TOKEN!,
SLACK_LOGGING_LEVEL: "DEBUG",
},
});

const req: Request ... // Standard Request object
const result = await app.run(req)
16 replies
CCConvex Community
Created by casen on 2/28/2024 in #support-community
Issue using crypto functions in http actions to verify slack web hooks
@erquhart @ballingt thanks for the reply! I did attempt that approach by passing the raw Request object to the action, but the Request object is circular, and non-serializable, so I got an error. I suppose I could abandon slack-edge and de-structure the Request object in such a way that I can pass the necessary pieces back to a Node.js action.
16 replies