ra-supabase

Supabase adapter for react-admin, the frontend framework for building admin applications on top of REST/GraphQL services.

MIT License

Downloads
5K
Stars
150
Committers
24

Bot releases are hidden (Show)

ra-supabase - 3.2.0

Published by fzaninotto about 2 months ago

  • Add ability to pass additional options to postgrest (#74) (fzaninotto)
  • Fix Reset Password form doesn't redirect to login page (#75) (fzaninotto)
  • Improve UI of set password & reset password pages (#76) (fzaninotto)
  • [Doc] Fix example in material UI readme (#73) (Patys)
  • [Doc] Fix code in dataProvider example in readme (#72) (Patys)
  • [Doc] Align style in readme for language packages(#71) (Patys)
ra-supabase - v3.1.1

Published by slax57 about 2 months ago

ra-supabase -

Published by djhi 2 months ago

  • Feat: Handle HashRouter & BrowserRouter for Supabase redirections (#67) (arimet)
  • Fix: It is no longer possible to access a page using direct URL if user is logged out (#65) (jonathan-marmelab
ra-supabase -

Published by djhi 4 months ago

  • The <LoginPage> will no longer automatically redirect to the app if the user is already authenticated
ra-supabase - 2.3.0

Published by djhi 4 months ago

  • Update supabase-js dev to match new auth system (#55) (Revarh)
  • [TypeScript] Allow react-router To type for UseRedirectIfAuthenticatedOptions (#56) (MohammedFaragallah)
ra-supabase - 2.2.0 Latest Release

Published by djhi 8 months ago

  • Add getPermissions support in authProvider (#50) kav
ra-supabase - 2.1.0

Published by djhi 9 months ago

  • Update to latest ra-data-postgrest (#47) (slax57)
ra-supabase - 2.0.6

Published by djhi 10 months ago

  • Fixes set password flow doesn't work (#44) n0rmanc
ra-supabase - 2.0.5

Published by djhi 10 months ago

  • Fix ra-language-french export
ra-supabase - 2.0.4

Published by djhi about 1 year ago

  • Add support for redirectTo in supabaseAuthProvider
  • Document spanish translations
ra-supabase - 2.0.3

Published by djhi over 1 year ago

  • Fix wrong build in 2.0.2
ra-supabase - 2.0.2

Published by djhi over 1 year ago

ra-supabase - 2.0.1

Published by djhi over 1 year ago

  • Fix invitations and password reset handling
ra-supabase - 2.0.0

Published by djhi over 1 year ago

  • Add compatibility with react-admin v4
  • Use ra-data-postgrest for the dataProvider
  • Add support for third party authentication providers

Migration

DataProvider

As we now use ra-data-postgrest, you now longer need to describe your resources. However, you must now pass the supabaseInstanceUrl and the apiKey:

// in dataProvider.js
import { supabaseDataProvider } from 'ra-supabase-core';
import { supabaseClient } from './supabase';

-const resources = {
-    posts: ['id', 'title', 'body', 'author_id', 'date'],
-    authors: ['id', 'full_name'],
-};

-export const dataProvider = supabaseDataProvider(supabaseClient, resources);
+export const dataProvider = supabaseDataProvider({
+    instanceUrl: 'YOUR_SUPABASE_URL',
+    apiKey: 'YOUR_SUPABASE_ANON_KEY',
+    supabaseClient
+});

When specifying the source prop of filter inputs, you can now either set it to the field name for simple equality checks or add an operator suffix for more control. For instance, the gte (Greater Than or Equal) or the ilike (Case insensitive like) operators:

const postFilters = [
    <TextInput label="Title" source="title@ilike" alwaysOn />,
    <TextInput label="Views" source="views@gte" />,
];

export const PostList = () => (
    <List filters={postFilters}>
        ...
    </List>
);

See the PostgREST documentation for a list of supported operators.

We used to have full-text search support that required a special configuration:

// in dataProvider.js
import { supabaseDataProvider } from 'ra-supabase';
import { supabase } from './supabase';

const resources = {
    posts: {
        fields: ['id', 'title', 'body', 'author_id', 'date'],
        fullTextSearchFields: ['title', 'body'],
    },
    authors: {
        fields: ['id', 'full_name'],
        fullTextSearchFields: ['full_name'],
    },
};

export const dataProvider = supabaseDataProvider(supabase, resources);

This is now longer required as you can use PostgREST operators for this purpose (fts, plfts and wfts). However this means the field on which you apply those operators must be of type tsvector. You can follow Supabase documentation to create one.

Here's how to add a SearchInput for such a column:

<SearchInput source="fts@my_column" />
ra-supabase -

Published by djhi about 3 years ago

  • Fix dataProvider.deleteMany (#7)
  • Fix Fix documentation examples (#8)
ra-supabase - 1.1.0

Published by fzaninotto about 3 years ago

  • Add authProvider and Authentication handling in dataProvider
  • Add i18n package for translating the auth UI
  • Add full-text search
  • Refactor to monorepo
ra-supabase - 1.0.0

Published by fzaninotto about 3 years ago

Initial release