Skip to content

Commit a8cee18

Browse files
committed
add sentry_supabase package
1 parent f8882e0 commit a8cee18

12 files changed

+182
-0
lines changed

supabase/.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Omit committing pubspec.lock for library packages; see
2+
# https://dart.dev/guides/libraries/private-files#pubspeclock.
3+
pubspec.lock
4+
5+
# Flutter/Dart/Pub related
6+
**/doc/api/
7+
**/ios/Flutter/.last_build_id
8+
.dart_tool/
9+
.flutter-plugins
10+
.flutter-plugins-dependencies
11+
.packages
12+
.pub-cache/
13+
.pub/
14+
/build/

supabase/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../CHANGELOG.md

supabase/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 Sentry
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

supabase/README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<p align="center">
2+
<a href="https://sentry.io" target="_blank" align="center">
3+
<img src="https://sentry-brand.storage.googleapis.com/sentry-logo-black.png" width="280">
4+
</a>
5+
<br />
6+
</p>
7+
8+
9+
===========
10+
11+
<p align="center">
12+
<a href="https://sentry.io" target="_blank" align="center">
13+
<img src="https://sentry-brand.storage.googleapis.com/sentry-logo-black.png" width="280">
14+
</a>
15+
<br />
16+
</p>
17+
18+
Sentry integration for `supabase` package
19+
===========
20+
21+
| package | build | pub | likes | popularity | pub points |
22+
|-------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------| ------- |
23+
| sentry_supabase | [![build](https://github.com/getsentry/sentry-dart/actions/workflows/supabase.yml/badge.svg?branch=main)](https://github.com/getsentry/sentry-dart/actions?query=workflow%3Asentry-supabase) | [![pub package](https://img.shields.io/pub/v/sentry_supabase.svg)](https://pub.dev/packages/sentry_supabase) | [![likes](https://img.shields.io/pub/likes/sentry_supabase)](https://pub.dev/packages/sentry_supabase/score) | [![popularity](https://img.shields.io/pub/popularity/sentry_supabase)](https://pub.dev/packages/sentry_supabase/score) | [![pub points](https://img.shields.io/pub/points/sentry_supabase)](https://pub.dev/packages/sentry_supabase/score)
24+
25+
Integration for [`supabase`](https://pub.dev/packages/supabase) package.
26+
27+
#### Usage
28+
29+
- Sign up for a Sentry.io account and get a DSN at https://sentry.io.
30+
31+
- Follow the installing instructions on [pub.dev](https://pub.dev/packages/sentry/install).
32+
33+
- Initialize the Sentry SDK using the DSN issued by Sentry.io.
34+
35+
- Call...
36+
37+
```dart
38+
39+
```
40+
41+
#### Resources
42+
43+
* [![Flutter docs](https://img.shields.io/badge/documentation-sentry.io-green.svg?label=flutter%20docs)](https://docs.sentry.io/platforms/flutter/)
44+
* [![Dart docs](https://img.shields.io/badge/documentation-sentry.io-green.svg?label=dart%20docs)](https://docs.sentry.io/platforms/dart/)
45+
* [![Discussions](https://img.shields.io/github/discussions/getsentry/sentry-dart.svg)](https://github.com/getsentry/sentry-dart/discussions)
46+
* [![Discord Chat](https://img.shields.io/discord/621778831602221064?logo=discord&logoColor=ffffff&color=7389D8)](https://discord.gg/PXa5Apfe7K)
47+
* [![Stack Overflow](https://img.shields.io/badge/stack%20overflow-sentry-green.svg)](https://stackoverflow.com/questions/tagged/sentry)
48+
* [![Twitter Follow](https://img.shields.io/twitter/follow/getsentry?label=getsentry&style=social)](https://twitter.com/intent/follow?screen_name=getsentry)

supabase/analysis_options.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# This file configures the static analysis results for your project (errors,
2+
# warnings, and lints).
3+
#
4+
# This enables the 'recommended' set of lints from `package:lints`.
5+
# This set helps identify many issues that may lead to problems when running
6+
# or consuming Dart code, and enforces writing Dart using a single, idiomatic
7+
# style and format.
8+
#
9+
# If you want a smaller set of lints you can change this to specify
10+
# 'package:lints/core.yaml'. These are just the most critical lints
11+
# (the recommended set includes the core lints).
12+
# The core lints are also what is used by pub.dev for scoring packages.
13+
14+
include: package:lints/recommended.yaml
15+
16+
# Uncomment the following section to specify additional rules.
17+
18+
# linter:
19+
# rules:
20+
# - camel_case_types
21+
22+
# analyzer:
23+
# exclude:
24+
# - path/to/excluded/files/**
25+
26+
# For more information about the core and recommended set of lints, see
27+
# https://dart.dev/go/core-lints
28+
29+
# For additional information about configuring this file, see
30+
# https://dart.dev/guides/language/analysis-options

supabase/dartdoc_options.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../dart/dartdoc_options.yaml
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import 'package:supabase/sentry_supabase.dart';
2+
3+
void main() {
4+
final client = SentrySupabaseClient();
5+
// TODO: Add supabase instumentation sample
6+
}

supabase/lib/sentry_supabase.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/// Support for doing something awesome.
2+
///
3+
/// More dartdocs go here.
4+
library;
5+
6+
export 'src/sentry_supabase.dart';
7+
8+
// TODO: Export any libraries intended for clients of this package.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import 'package:http/http.dart';
2+
3+
class SentrySupabaseClient extends BaseClient {
4+
late final Client innerClient;
5+
6+
SentrySupabaseClient({Client? client}) {
7+
innerClient = client ?? Client();
8+
}
9+
10+
@override
11+
Future<StreamedResponse> send(BaseRequest request) {
12+
13+
// TODO: Instrument the supabase request
14+
15+
return innerClient.send(request);
16+
}
17+
}

supabase/pubspec.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: sentry_supabase
2+
description: "Sentry integration to use instument Supabase."
3+
version: 9.0.0-alpha.2
4+
homepage: https://docs.sentry.io/platforms/flutter/
5+
repository: https://github.com/getsentry/sentry-dart
6+
issue_tracker: https://github.com/getsentry/sentry-dart/issues
7+
8+
environment:
9+
sdk: '>=3.5.0 <4.0.0'
10+
11+
dependencies:
12+
http: ^1.3.0
13+
14+
dev_dependencies:
15+
supabase: ^2.6.0
16+
lints: ^5.0.0
17+
test: ^1.24.0

supabase/pubspec_overrides.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dependency_overrides:
2+
sentry:
3+
path: ../dart

supabase/test/supabase_test.dart

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import 'package:sentry_supabase/sentry_supabase.dart';
2+
import 'package:test/test.dart';
3+
4+
void main() {
5+
group('A group of tests', () {
6+
final client = SentrySupabaseClient();
7+
8+
setUp(() {
9+
// Additional setup goes here.
10+
});
11+
12+
test('Sample test', () {
13+
expect(client, isNotNull);
14+
});
15+
});
16+
}

0 commit comments

Comments
 (0)