iScream
CCConvex Community
•Created by burnstony#1975 on 11/19/2024 in #support-community
Choosing a React Framework
React has wide community support as it is still the most used frontend framework hence Convex has the best support for React. If you are new to React and Convex, the best is to stick to these well supported and widely used combination because whenever you have issues which cannot be resolved by ChatGPT, you will have better chance to find support in these communities.
(I recommend using React with Convex as a big fan of Svelte.)
13 replies
CCConvex Community
•Created by ian on 9/18/2024 in #support-community
How can I re-use table validators?
I'm not sure this is the question you are asking, but in my Convex queries, mutations and helper functions I referred table entry types with the generated DataModel imported from _generated folder like so:
export const withStorageImage = async (
ctx: GenericQueryCtx<DataModel>,
user: DataModel['users']['document'] | null
): Promise<DataModel['users']['document'] | null> => {
[...]
const url = await ctx.storage.getUrl(user.image as Id<'_storage'>);
[...]
return user;
};
14 replies
CCConvex Community
•Created by i.sona on 9/23/2024 in #support-community
convex-auth with sveltekit
I used AuthJS with SvelteKit in my recent project based on these two tutorials:
https://stack.convex.dev/nextauth-adapter
https://stack.convex.dev/nextauth
Most of these are not required if you are using Convex Auth, but in both cases you will need your own ConvexAuthProvider Svelte component which is like:
<script lang="ts">
import { variables } from '$lib/variables';
import { setupConvex, useConvexClient } from 'convex-svelte';
let {
token,
children
}: {
children: any;
token: string | undefined | null;
} = $props();
// initialise Convex context
setupConvex(variables.convexUrl);
// set ID token for convex client if available in the session (aka the user is logged in)
$effect.pre(() => {
if (token) {
const client = useConvexClient();
client.setAuth(async () => token);
}
});
</script>
{@render children()}
3 replies
CCConvex Community
•Created by GhostBob on 9/17/2024 in #support-community
Svelte: server side: call queries?
6 replies
CCConvex Community
•Created by DerPenz on 8/30/2023 in #support-community
Is svelte support planned? update: its supported!
I guess so.
69 replies
CCConvex Community
•Created by DerPenz on 8/30/2023 in #support-community
Is svelte support planned? update: its supported!
I use Auth.js. There are tutorials in Convex doc about it, but I had to implement my own component instead of the React one. The tutorials describe auth.js setup, custom adapter and Convex function implementations.
69 replies
CCConvex Community
•Created by DerPenz on 8/30/2023 in #support-community
Is svelte support planned? update: its supported!
69 replies
CCConvex Community
•Created by DerPenz on 8/30/2023 in #support-community
Is svelte support planned? update: its supported!
There is a bug opened in svelte-chartjs about Svelte 5 (https://github.com/SauravKanchan/svelte-chartjs/issues/158). The author does not show any activity in the repo, but there are some contributors whom might be worth pinging.
69 replies
CCConvex Community
•Created by DerPenz on 8/30/2023 in #support-community
Is svelte support planned? update: its supported!
I also use it, and all it does just warn about
context="module"
is being deprecated and use the module
attribute instead. Do you have any other issue?69 replies
CCConvex Community
•Created by DerPenz on 8/30/2023 in #support-community
Is svelte support planned? update: its supported!
The project is private on github yet, but I will open it to public after 17th of September. Till then check out the result if you are interested: https://discord.com/channels/1019350475847499849/1283704544932397056/1283704544932397056
69 replies
CCConvex Community
•Created by DerPenz on 8/30/2023 in #support-community
Is svelte support planned? update: its supported!
Hi @GhostBob, I was in your shoes when I decided to join the hackathon (vol 2). All I did with Svelte before was relying on Svelte 4 but convex-svelte is built on Svelte 5, so it forced me to learn Svelte 5, and replace everything which does not support it. It has only been a two weeks journey in total but it was worth the effort. Svelte 5 is so much easier than Svelte 4, so I would recommend switching to it even if you feel it hurts.
69 replies