Skip to main content

supabase_functions 3.0.0-dev.13 copy "supabase_functions: ^3.0.0-dev.13" to clipboard
supabase_functions: ^3.0.0-dev.13 copied to clipboard

A Dart client library for Supabase Edge Functions, to invoke your functions from Dart and Flutter apps and read their responses.

example/main.dart

// ignore_for_file: avoid_print

import 'package:supabase_functions/supabase_functions.dart';

/// Example to use with Supabase Edge Functions https://supabase.com/
Future<void> main() async {
  const supabaseUrl = 'https://your-project.supabase.co';
  const supabaseKey = 'your-publishable-key';
  final client = FunctionsClient(
    '$supabaseUrl/functions/v1',
    {'apikey': supabaseKey},
  );

  try {
    final response = await client.invoke(
      'get_countries',
      body: {'name': 'The Shire'},
      region: FunctionsRegion.euWest1,
    );
    print('status: ${response.statusCode}');
    print('content type: ${response.headers['content-type']}');
    print('data: ${response.data}');
  } on FunctionsApiException catch (error) {
    print('Function error: ${error.statusCode} ${error.message}');
  } on FunctionsException catch (error) {
    print('Function error: ${error.message} ${error.details}');
  } finally {
    await client.dispose();
  }
}
9
likes
160
points
1.39k
downloads

Documentation

Documentation
API reference

Publisher

verified publishersupabase.io

Weekly Downloads

A Dart client library for Supabase Edge Functions, to invoke your functions from Dart and Flutter apps and read their responses.

Homepage
Repository (GitHub)
View/report issues

Topics

#supabase #functions #edge-functions #backend #api

License

MIT (license)

Dependencies

http, logging, meta, supabase_common, yet_another_json_isolate

More

Packages that depend on supabase_functions