{"id":20157508,"url":"https://github.com/lehuyh/supabase-java","last_synced_at":"2026-03-07T01:01:47.486Z","repository":{"id":210434344,"uuid":"726553679","full_name":"LehuyH/supabase-java","owner":"LehuyH","description":"A Java client for Supabase","archived":false,"fork":false,"pushed_at":"2023-12-04T01:09:43.000Z","size":10,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-09T03:02:42.262Z","etag":null,"topics":["client","java","supabase"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LehuyH.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-02T18:03:11.000Z","updated_at":"2025-02-25T17:48:47.000Z","dependencies_parsed_at":"2025-01-13T12:46:13.860Z","dependency_job_id":"7bf110ad-75d4-46a7-861d-815d197af73a","html_url":"https://github.com/LehuyH/supabase-java","commit_stats":null,"previous_names":["lehuyh/supabase-java"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LehuyH/supabase-java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LehuyH%2Fsupabase-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LehuyH%2Fsupabase-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LehuyH%2Fsupabase-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LehuyH%2Fsupabase-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LehuyH","download_url":"https://codeload.github.com/LehuyH/supabase-java/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LehuyH%2Fsupabase-java/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30204452,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T19:07:06.838Z","status":"ssl_error","status_checked_at":"2026-03-06T18:57:34.882Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["client","java","supabase"],"created_at":"2024-11-13T23:46:32.394Z","updated_at":"2026-03-07T01:01:47.442Z","avatar_url":"https://github.com/LehuyH.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Supabase-Java 🚀\n\nSupabase-Java is a Java library that simplifies interaction with the Supabase.\n\n## Features ✨\n\n- **User Authentication:** Perform user authentication operations.\n- **Serverless Functions:** Invoke serverless functions.\n- **PostgREST Interaction:** Interact with the Supabase database using the PostgREST API. Supports all filters and operations.\n- **JavaScript Like Syntax:** Closely matches the chaining syntax of `supabase-js`\n\n\n## Installation 🛠️\n\nTo use Supabase-Java in your Java project:\n\n0. **Get your Supabase Credentials:**\n\n   If you are not using a self-hosted / local instance, you can use the [hosted version](https://supabase.com/dashboard)\n   \n1. **Download Source Code:**\n\n   Clone or download the source code of this library from the repository.\n\n2. **Include in Your Project:**\n\n   - Include the downloaded `supabase-java` source code into your project structure.\n   - Adjust your project configuration (e.g., Maven or Gradle) to include the library source files.\n\n\n## Usage 🚀\n\nUsing Supabase-Java is straightforward. Here's some common use cases:\n\n1. **Initialize Supabase Client:**\n\n   ```java\n   SupabaseClient supabase = new SupabaseClient(\"https://your-supabase-url.com\", \"your-api-key\");\n   ```\n\n2. **Configure Authentication:**\n\n   ```java\n   // Access the auth instance\n   GoTrue auth = supabase.auth;\n\n   // Example: Sign up a new user\n   auth.signUp(\"user@example.com\", \"password123\");\n   ```\n\n3. **Invoke Serverless Functions:**\n\n   ```java\n   // Access the functions client\n   FunctionsClient functionsClient = supabase.functions;\n\n   // Example: Invoke a serverless function\n   String result = functionsClient.invoke(\"functionName\");\n   ```\n\n4. **Work with the Database:**\n\n   ```java\n   // Access the Postgrest client\n   PostgrestClient postgrestClient = supabase.from(\"tasks\");\n\n   // Example: Select query with filters and ordering\n   JSONObject response = postgrestClient\n       .select(\"id, task_name, completed\")\n       .eq(\"completed\", \"false\")\n       .order(\"created_at\")\n       .limit(10)\n       .exec();\n   ```\n\n## Contributing 🤝\n\nContributions, bug reports, and feature requests are welcome! Feel free to open issues and pull requests.\n\n## License 📄\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n---\n\n\n### `SupabaseClient`\n\nThe `SupabaseClient` class is the main entry point for interacting with Supabase in Java.\n\n#### Constructors\n\n- `SupabaseClient(String supabaseUrl, String supabaseKey)`: Initializes the Supabase client with the Supabase URL and API key.\n\n#### Accessing Subclasses\n\n- `auth`: Instance of `GoTrue` class for handling user authentication.\n- `functions`: Instance of `FunctionsClient` for invoking serverless functions.\n- `from`: Function that returns an instance of `PostgrestClient` for handling database requests\n\n\n\n### `PostgrestClient`\n\nThe `PostgrestClient` class provides functionalities to interact with the Supabase database using the PostgREST API.\n\n#### Methods\n\n- Methods for building queries to interact with the database by specifying select queries, filters, ordering, limits, inserts, updates, and deletions.\n\nAs the `PostgrestClient` is accessed through an instance of `SupabaseClient`, here's an overview of how to use it:\n\n```java\nSupabaseClient supabase = new SupabaseClient(\"https://your-supabase-url.com\", \"your-api-key\");\nPostgrestClient postgrestClient = supabase.from(\"table_name\");\n```\n\nThe following methods can be used on `PostgrestClient`:\n\n#### Query Building Methods\n\n- `select(String selectQuery)`: Specifies the columns to retrieve.\n- `eq(String column, String value)`: Filters by equality.\n- `neq(String column, String value)`: Filters by inequality.\n- `gt(String column, String value)`: Filters by greater than.\n- `gte(String column, String value)`: Filters by greater than or equal to.\n- `lt(String column, String value)`: Filters by less than.\n- `lte(String column, String value)`: Filters by less than or equal to.\n- `like(String column, String value)`: Filters by pattern matching.\n- `ilike(String column, String value)`: Filters by case-insensitive pattern matching.\n- `is(String column, String value)`: Filters by null or not null values.\n- `in(String column, T[] values)`: Filters by inclusion in an array.\n- `contains(String column, T[] values)`: Filters by containing elements in an array.\n- `containedBy(String column, T[] values)`: Filters by being contained by another array.\n- `rangeGt(String column, T[] range)`: Filters by range greater than.\n- `rangeGte(String column, T[] range)`: Filters by range greater than or equal to.\n- `rangeLt(String column, T[] range)`: Filters by range less than.\n- `rangeLte(String column, T[] range)`: Filters by range less than or equal to.\n- `rangeAdjacent(String column, T[] range)`: Filters by adjacent range.\n- `overlaps(String column, T[] range)`: Filters by overlapping range.\n- `textSearch(String column, String query, PostgrestFullTextSearchOptions options)`: Performs a full-text search.\n- `match(Map\u003cString, T\u003e columnValueMap)`: Filters by matching multiple columns to specified values.\n- `not(String column, String operator, String value)`: Negates a filter.\n- `or(String orFilters)`: Combines multiple filters using logical OR.\n- `or(String orFilters, String foreignTable)`: Combines multiple filters on a foreign table using logical OR.\n- `filter(String column, String operator, String value)`: Applies a custom filter.\n- `order(String column, PostgrestOrderOptions options)`: Orders the result set by column.\n- `order(String column)`: Orders the result set by column (default ordering).\n- `limit(int limit)`: Limits the number of records returned.\n- `limit(int limit, String foreignTable)`: Limits the number of records returned from a foreign table.\n- `range(int from, int to)`: Limits the records returned within a specified range.\n- `range(int from, int to, String foreignTable)`: Limits the records returned from a foreign table within a specified range.\n- `single()`: Limits the result to a single record.\n- `csv()`: Requests data in CSV format.\n- `insert(JSONObject body)`: Inserts a new record.\n- `insert(JSONArray body)`: Inserts multiple records.\n- `upsert(JSONObject body)`: Upserts a record (inserts or updates).\n- `upsert(JSONArray body)`: Upserts multiple records.\n- `update(JSONObject body)`: Updates existing records.\n- `delete()`: Deletes records.\n\nExample usage of `PostgrestClient` methods:\n\n```java\nPostgrestClient postgrestClient = supabase.from(\"tasks\");\n\n// Example: Select query with filters and ordering\nJSONObject response = postgrestClient\n    .select(\"id, task_name, completed\")\n    .eq(\"completed\", \"false\")\n    .limit(10)\n    .exec();\n\n// Example: Inserting a new record\nJSONObject newTask = new JSONObject();\nnewTask.put(\"task_name\", \"Sample Task\");\nnewTask.put(\"completed\", false);\nJSONObject insertResponse = postgrestClient.insert(newTask).exec();\n```\n\n\n\n### `Authentication With GoTrue`\n\nThe `GoTrue` class handles user authentication functionalities within the SupabaseClient.\n\n#### Methods\n\n- `getSession()`: Retrieves the user session.\n- `signUp(String email, String password)`: Registers a new user with the provided email and password.\n- `signInWithPassword(String email, String password)`: Authenticates a user using email and password.\n- `getUser()`: Retrieves user information.\n\nExample:\n```java\nSupabaseClient supabase = new SupabaseClient(\"https://your-supabase-url.com\", \"your-api-key\");\n// Accessing GoTrue instance from SupabaseClient\nGoTrue auth = supabase.auth;\n\n// Usage examples of GoTrue methods\nJSONObject session = auth.getSession();\nauth.signUp(\"user@example.com\", \"password123\");\nauth.signInWithPassword(\"user@example.com\", \"password123\");\nJSONObject user = auth.getUser();\n```\n\n### `FunctionsClient`\n\nThe `FunctionsClient` class facilitates invoking serverless functions provided by Supabase.\n\n#### Methods\n\n- `invoke(String name)`: Invokes a serverless function by name.\n- `invoke(String name, JSONObject body)`: Invokes a serverless function with a request body.\n- `invoke(String name, JSONObject body, JSONObject headers)`: Invokes a serverless function with specified headers.\n- `invoke(String name, JSONObject body, JSONObject headers, String method)`: Invokes a serverless function with specified headers and HTTP method.\n\nExample:\n```java\nSupabaseClient supabase = new SupabaseClient(\"https://your-supabase-url.com\", \"your-api-key\");\n// Accessing FunctionsClient instance from SupabaseClient\nFunctionsClient functionsClient = supabase.functions;\n\n// Usage examples of FunctionsClient methods\nString result1 = functionsClient.invoke(\"functionName\");\nJSONObject requestBody = new JSONObject();\nString result2 = functionsClient.invoke(\"functionName\", requestBody);\nJSONObject requestHeaders = new JSONObject();\nString result3 = functionsClient.invoke(\"functionName\", requestBody, requestHeaders);\nString result4 = functionsClient.invoke(\"functionName\", requestBody, requestHeaders, \"POST\");\n```\n\n## Folder Structure\n\nThe workspace contains two folders by default, where:\n\n- `src`: the folder to maintain sources\n- `lib`: the folder to maintain dependencies\n\nMeanwhile, the compiled output files will be generated in the `bin` folder by default.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flehuyh%2Fsupabase-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flehuyh%2Fsupabase-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flehuyh%2Fsupabase-java/lists"}