Skip to content

Files

Latest commit

5fa2f64 · Nov 28, 2024

History

History

nhost_dart

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Nov 17, 2023
Nov 8, 2023
Jul 19, 2024
Mar 13, 2023
Nov 28, 2024
Mar 13, 2023
Aug 29, 2023
Mar 13, 2023
Mar 13, 2023
Nov 28, 2024
Nov 8, 2023

Nhost Dart SDK

Pub nhost_dart tests

Nhost authentication and file storage API clients for Dart and Flutter.

Includes support for:

  • User sign in and registration, including multi-factor authentication
  • Email and password changes, either directly or via email confirmation
  • Storage and retrieval of arbitrary files
  • Scaling and transformation of stored files
  • GraphQL authentication, via nhost_graphql_adapter

Sample

import 'package:nhost_dart/nhost_dart.dart';

void main() async {
  final nhost = NhostClient(
    subdomain: Subdomain(
        region: 'eu-central-1',
        subdomain: 'backend-5e69d1d7',
      ),
    );


    // for self host or local host you may use ServiceUrls
    /*
    final nhost = NhostClient(
      serviceUrls: ServiceUrls(
        authUrl: '',
        storageUrl: '',
        functionsUrl: '',
        graphqlUrl: '',
      ),
    );
    */

  // User registration
  await nhost.auth.register(email: 'new-user@gmail.com', password: 'xxxxx');

  // Upload a file
  final currentUser = nhost.auth.currentUser;
  await nhost.storage.uploadBytes(
    filePath: '/users/${currentUser.id}/image.jpg',
    bytes: [/* ... */],
    contentType: 'image/jpeg',
  ),

  // Log out
  await nhost.auth.logout();
}

Getting Started

Latest Release

dependencies:
  nhost_dart: ^1.0.1

🔥 More Dart & Flutter packages from Nhost