Table of Contents
Easily set up collaborative editing with Supabase Realtime! Built with YJS.
Not recommended for production use in its current state.
Contributors welcome!
"@kamick/supabaseprovider": "^0.0.2",
Input:
export interface SupabaseProviderConfiguration {
/**
* The identifier/name of your document
*/
name: string;
/**
* The actual Y.js document
*/
document: Y.Doc;
/**
* The awareness instance
*/
awareness?: Awareness;
/**
* Details about the database to connect to
*/
databaseDetails: {
schema: string,
table: string,
updateColumns: { name: string, content: string },
conflictColumns: string
}
}
Example usage with React:
const supabase = createClientComponentClient<Database>();
const router = useRouter();
const doc = useMemo(() => new Y.Doc(), []);
const provider =
useMemo(() => new SupabaseProvider(supabase, {
name: documentName,
document: doc,
databaseDetails: {
schema: {schema},
table: {table},
updateColumns: { name: {column_name}, content: {column_content} },
conflictColumns: {conflict_columns_comma_concat},
},
}), [doc, documentName, supabase]);
return <TipTapEditor doc={doc} provider={provider} user={user} router={router} />;
- Add Changelog
- Add Additional Templates w/ Examples
- Add Testing
- Production ready
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Kevin Amick - @kevinamick - kevinamick81@gmail.com
Project Link: https://github.com/kevinamick/supabaseprovider