Skip to content

kevinamick/supabaseprovider

Repository files navigation

Forks Stargazers Issues MIT License


Table of Contents
  1. About The Project
  2. Usage
  3. Roadmap
  4. Contributing
  5. License
  6. Contact

About The Project

Easily set up collaborative editing with Supabase Realtime! Built with YJS.

Not recommended for production use in its current state.

Contributors welcome!

(back to top)

Usage

"@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} />;

(back to top)

Roadmap

  • 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).

(back to top)

Contributing

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!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Kevin Amick - @kevinamick - kevinamick81@gmail.com

Project Link: https://github.com/kevinamick/supabaseprovider

(back to top)

About

A TipTap collboration provider using Supabase realtime

Resources

License

Stars

Watchers

Forks

Packages

No packages published