{"id":15484716,"url":"https://github.com/thealphamerc/dub-dart","last_synced_at":"2025-04-22T16:48:32.921Z","repository":{"id":236348613,"uuid":"792440517","full_name":"TheAlphamerc/dub-dart","owner":"TheAlphamerc","description":"Unofficial Dub.co Flutter Dart Client SDK","archived":false,"fork":false,"pushed_at":"2024-06-17T05:21:36.000Z","size":516,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T16:51:10.817Z","etag":null,"topics":["api-client","dub","link-shortener"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/dub","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TheAlphamerc.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2024-04-26T17:11:35.000Z","updated_at":"2024-12-22T13:14:54.000Z","dependencies_parsed_at":"2024-06-16T07:55:42.607Z","dependency_job_id":"f07b054e-28c2-44b8-a320-bdf7238c71f6","html_url":"https://github.com/TheAlphamerc/dub-dart","commit_stats":null,"previous_names":["thealphamerc/dub-dart"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheAlphamerc%2Fdub-dart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheAlphamerc%2Fdub-dart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheAlphamerc%2Fdub-dart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheAlphamerc%2Fdub-dart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheAlphamerc","download_url":"https://codeload.github.com/TheAlphamerc/dub-dart/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250281673,"owners_count":21404835,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["api-client","dub","link-shortener"],"created_at":"2024-10-02T05:41:41.072Z","updated_at":"2025-04-22T16:48:32.895Z","avatar_url":"https://github.com/TheAlphamerc.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dub (EXPERIMENTAL)\n\nDub is link management infrastructure for companies to create marketing campaigns, link sharing features, and referral programs.\n\nFor more information, please visit [https://dub.co/api](https://dub.co/api)\n\n## Requirements\n\n- Dart 2.15.0+ or Flutter 2.8.0+\n- Dio 5.0.0+ (https://pub.dev/packages/dio)\n- JSON Serializable 6.1.5+ (https://pub.dev/packages/json_serializable)\n\n## Installation \u0026 Usage\n\n### pub.dev\n\nTo use the package from [pub.dev](https://pub.dev), please include the following in pubspec.yaml\n\n```yaml\ndependencies:\n  dub: 0.0.3\n```\n\n### Github\n\nTo use this package from [Github](https://github.com), please include the following in pubspec.yaml\n\n```yaml\ndependencies:\n  dub:\n    git:\n      url: https://github.com/thealphamerc/dub-dart.git\n      #ref: main\n```\n\n### Local development\n\nTo use the package from your local drive, please include the following in pubspec.yaml\n\n```yaml\ndependencies:\n  dub:\n    path: /path/to/dub\n```\n\n## Getting Started\n\nPlease follow the [installation procedure](#installation--usage) and then run the following:\n\n```dart\nimport 'package:dub/dub.dart';\n\n\nfinal api = Dub().getLinksApi();\nfinal analyticsApi = Dub().getAnalyticsApi();\nfinal String workspaceId = 'ws_cluuwcv0r....' // String | The ID of the workspace.\n\n// Create a link\ntry {\n    final response = await api.createLink(\n      workspaceId: workspaceId!,\n      createLinkRequest: CreateLinkRequest(\n        url: 'https://www.google.com',\n        externalId: \"12345\", // Optional\n      ),\n    );\n    print(response);\n} catch on DioException (e) {\n    print(\"Exception when calling LinkAPI-\u003ecreateLink: $e\\n\");\n}\n\n// Upsert a link\n// Update the link if same URL already exists or create a new link\ntry {\n    final response = await api.upsertLink(\n      workspaceId: workspaceId!,\n      createLinkRequest: CreateLinkRequest(\n        url: 'https://www.google.com',\n        externalId: \"12345\", // Optional\n      ),\n    );\n    print(response);\n} catch on DioException (e) {\n    print(\"Exception when calling LinkAPI-\u003eupsertLink: $e\\n\");\n}\n\n// Update a link\ntry {\n    final response = await api.upsertLink(\n      linkId: 'clv3o9p9q000au1h0mc7r6l63',\n      workspaceId: workspaceId!,\n      createLinkRequest: CreateLinkRequest(\n        url: 'https://www.google.com',\n      ),\n    );\n\n    // Update a link by its externalId\n    final response2 = await api.upsertLink(\n      linkId: 'ext_12345',\n      workspaceId: workspaceId!,\n      createLinkRequest: CreateLinkRequest(\n        url: 'https://www.google.com',\n      ),\n    );\n    print(response);\n} catch on DioException (e) {\n    print(\"Exception when calling LinkAPI-\u003eupsertLink: $e\\n\");\n}\n\n// Retrieve the timeseries analytics for the last 7 days for a link\ntry {\n    final response = await analyticsApi.retrieveAnalytics(\n        linkId: 'clv3o9p9q000au1h0mc7r6l63',\n        workspaceId: workspaceId,\n        interval: '7d',\n        event: 'click',\n        groupBy: 'timeseries'\n      );\n    print(response);\n} catch on DioException (e) {\n    print(\"Exception when calling AnalyticsAPI-\u003eretrieveAnalytics: $e\\n\");\n}\n```\n\n## Documentation for API Endpoints\n\nAll URIs are relative to *https://api.dub.co*\n\n| Class                                   | Method                                                         | HTTP request                      | Description                                                              |\n| --------------------------------------- | -------------------------------------------------------------- | --------------------------------- | ------------------------------------------------------------------------ |\n| [_AnalyticsApi_](doc/AnalyticsApi.md)   | [**retrieveAnalytics**](doc/AnalyticsApi.md#retrieveanalytics) | **GET** /analytics                | Retrieve analytics for a link, a domain, or the authenticated workspace. |\n| [_DomainsApi_](doc/DomainsApi.md)       | [**addDomain**](doc/DomainsApi.md#adddomain)                   | **POST** /domains                 | Add a domain                                                             |\n| [_DomainsApi_](doc/DomainsApi.md)       | [**deleteDomain**](doc/DomainsApi.md#deletedomain)             | **DELETE** /domains/{slug}        | Delete a domain                                                          |\n| [_DomainsApi_](doc/DomainsApi.md)       | [**listDomains**](doc/DomainsApi.md#listdomains)               | **GET** /domains                  | Retrieve a list of domains                                               |\n| [_DomainsApi_](doc/DomainsApi.md)       | [**setPrimaryDomain**](doc/DomainsApi.md#setprimarydomain)     | **POST** /domains/{slug}/primary  | Set a domain as primary                                                  |\n| [_DomainsApi_](doc/DomainsApi.md)       | [**transferDomain**](doc/DomainsApi.md#transferdomain)         | **POST** /domains/{slug}/transfer | Transfer a domain                                                        |\n| [_DomainsApi_](doc/DomainsApi.md)       | [**updateDomain**](doc/DomainsApi.md#updatedomain)             | **PATCH** /domains/{slug}         | Update a domain                                                          |\n| [_LinksApi_](doc/LinksApi.md)           | [**bulkCreateLinks**](doc/LinksApi.md#bulkcreatelinks)         | **POST** /links/bulk              | Bulk create links                                                        |\n| [_LinksApi_](doc/LinksApi.md)           | [**createLink**](doc/LinksApi.md#createlink)                   | **POST** /links                   | Create a new link                                                        |\n| [_LinksApi_](doc/LinksApi.md)           | [**deleteLink**](doc/LinksApi.md#deletelink)                   | **DELETE** /links/{linkId}        | Delete a link                                                            |\n| [_LinksApi_](doc/LinksApi.md)           | [**getLinkInfo**](doc/LinksApi.md#getlinkinfo)                 | **GET** /links/info               | Retrieve a link                                                          |\n| [_LinksApi_](doc/LinksApi.md)           | [**getLinks**](doc/LinksApi.md#getlinks)                       | **GET** /links                    | Retrieve a list of links                                                 |\n| [_LinksApi_](doc/LinksApi.md)           | [**getLinksCount**](doc/LinksApi.md#getlinkscount)             | **GET** /links/count              | Retrieve the number of links                                             |\n| [_LinksApi_](doc/LinksApi.md)           | [**updateLink**](doc/LinksApi.md#updatelink)                   | **PATCH** /links/{linkId}         | Update a link                                                            |\n| [_LinksApi_](doc/LinksApi.md)           | [**upsertLink**](doc/LinksApi.md#upsertlink)                   | **PUT** /links/upsert             | Upsert a link                                                            |\n| [_MetatagsApi_](doc/MetatagsApi.md)     | [**getMetatags**](doc/MetatagsApi.md#getmetatags)              | **GET** /metatags                 | Retrieve the metatags for a URL                                          |\n| [_QRCodesApi_](doc/QRCodesApi.md)       | [**getQRCode**](doc/QRCodesApi.md#getqrcode)                   | **GET** /qr                       | Retrieve a QR code                                                       |\n| [_TagsApi_](doc/TagsApi.md)             | [**createTag**](doc/TagsApi.md#createtag)                      | **POST** /tags                    | Create a new tag                                                         |\n| [_TagsApi_](doc/TagsApi.md)             | [**getTags**](doc/TagsApi.md#gettags)                          | **GET** /tags                     | Retrieve a list of tags                                                  |\n| [_TrackApi_](doc/TrackApi.md)           | [**trackCustomer**](doc/TrackApi.md#trackcustomer)             | **POST** /track/customer          | Track a customer                                                         |\n| [_TrackApi_](doc/TrackApi.md)           | [**trackLead**](doc/TrackApi.md#tracklead)                     | **POST** /track/lead              | Track a lead                                                             |\n| [_TrackApi_](doc/TrackApi.md)           | [**trackSale**](doc/TrackApi.md#tracksale)                     | **POST** /track/sale              | Track a sale                                                             |\n| [_WorkspacesApi_](doc/WorkspacesApi.md) | [**createWorkspace**](doc/WorkspacesApi.md#createworkspace)    | **POST** /workspaces              | Create a workspace                                                       |\n| [_WorkspacesApi_](doc/WorkspacesApi.md) | [**getWorkspace**](doc/WorkspacesApi.md#getworkspace)          | **GET** /workspaces/{idOrSlug}    | Retrieve a workspace                                                     |\n| [_WorkspacesApi_](doc/WorkspacesApi.md) | [**getWorkspaces**](doc/WorkspacesApi.md#getworkspaces)        | **GET** /workspaces               | Retrieve a list of workspaces                                            |\n\n## Documentation For Models\n\n- [AddDomainRequest](doc/AddDomainRequest.md)\n- [ClicksBrowsers](doc/ClicksBrowsers.md)\n- [ClicksCities](doc/ClicksCities.md)\n- [ClicksCount](doc/ClicksCount.md)\n- [ClicksCountries](doc/ClicksCountries.md)\n- [ClicksDevices](doc/ClicksDevices.md)\n- [ClicksOS](doc/ClicksOS.md)\n- [ClicksReferers](doc/ClicksReferers.md)\n- [ClicksTimeseries](doc/ClicksTimeseries.md)\n- [ClicksTopLinks](doc/ClicksTopLinks.md)\n- [ClicksTopUrls](doc/ClicksTopUrls.md)\n- [CountryCode](doc/CountryCode.md)\n- [CreateLinkRequest](doc/CreateLinkRequest.md)\n- [CreateLinkRequestTagIds](doc/CreateLinkRequestTagIds.md)\n- [CreateTagRequest](doc/CreateTagRequest.md)\n- [CreateWorkspaceRequest](doc/CreateWorkspaceRequest.md)\n- [DeleteDomain200Response](doc/DeleteDomain200Response.md)\n- [DeleteLink200Response](doc/DeleteLink200Response.md)\n- [DomainSchema](doc/DomainSchema.md)\n- [GetLinks400Response](doc/GetLinks400Response.md)\n- [GetLinks400ResponseError](doc/GetLinks400ResponseError.md)\n- [GetLinks401Response](doc/GetLinks401Response.md)\n- [GetLinks401ResponseError](doc/GetLinks401ResponseError.md)\n- [GetLinks403Response](doc/GetLinks403Response.md)\n- [GetLinks403ResponseError](doc/GetLinks403ResponseError.md)\n- [GetLinks404Response](doc/GetLinks404Response.md)\n- [GetLinks404ResponseError](doc/GetLinks404ResponseError.md)\n- [GetLinks409Response](doc/GetLinks409Response.md)\n- [GetLinks409ResponseError](doc/GetLinks409ResponseError.md)\n- [GetLinks410Response](doc/GetLinks410Response.md)\n- [GetLinks410ResponseError](doc/GetLinks410ResponseError.md)\n- [GetLinks422Response](doc/GetLinks422Response.md)\n- [GetLinks422ResponseError](doc/GetLinks422ResponseError.md)\n- [GetLinks429Response](doc/GetLinks429Response.md)\n- [GetLinks429ResponseError](doc/GetLinks429ResponseError.md)\n- [GetLinks500Response](doc/GetLinks500Response.md)\n- [GetLinks500ResponseError](doc/GetLinks500ResponseError.md)\n- [GetLinksCountGroupByParameter](doc/GetLinksCountGroupByParameter.md)\n- [GetLinksTagIdsParameter](doc/GetLinksTagIdsParameter.md)\n- [GetLinksTagNamesParameter](doc/GetLinksTagNamesParameter.md)\n- [GetMetatags200Response](doc/GetMetatags200Response.md)\n- [LeadsBrowsers](doc/LeadsBrowsers.md)\n- [LeadsCities](doc/LeadsCities.md)\n- [LeadsCount](doc/LeadsCount.md)\n- [LeadsCountries](doc/LeadsCountries.md)\n- [LeadsDevices](doc/LeadsDevices.md)\n- [LeadsOS](doc/LeadsOS.md)\n- [LeadsReferers](doc/LeadsReferers.md)\n- [LeadsTimeseries](doc/LeadsTimeseries.md)\n- [LeadsTopLinks](doc/LeadsTopLinks.md)\n- [LeadsTopUrls](doc/LeadsTopUrls.md)\n- [LinkGeoTargeting](doc/LinkGeoTargeting.md)\n- [LinkSchema](doc/LinkSchema.md)\n- [LinkSchemaGeo](doc/LinkSchemaGeo.md)\n- [RetrieveAnalytics200Response](doc/RetrieveAnalytics200Response.md)\n- [SalesBrowsers](doc/SalesBrowsers.md)\n- [SalesCities](doc/SalesCities.md)\n- [SalesCount](doc/SalesCount.md)\n- [SalesCountries](doc/SalesCountries.md)\n- [SalesDevices](doc/SalesDevices.md)\n- [SalesOS](doc/SalesOS.md)\n- [SalesReferers](doc/SalesReferers.md)\n- [SalesTimeseries](doc/SalesTimeseries.md)\n- [SalesTopLinks](doc/SalesTopLinks.md)\n- [SalesTopUrls](doc/SalesTopUrls.md)\n- [TagSchema](doc/TagSchema.md)\n- [TrackCustomer200Response](doc/TrackCustomer200Response.md)\n- [TrackCustomerRequest](doc/TrackCustomerRequest.md)\n- [TrackLead200Response](doc/TrackLead200Response.md)\n- [TrackLeadRequest](doc/TrackLeadRequest.md)\n- [TrackSale200Response](doc/TrackSale200Response.md)\n- [TrackSaleRequest](doc/TrackSaleRequest.md)\n- [TransferDomainRequest](doc/TransferDomainRequest.md)\n- [UpdateDomainRequest](doc/UpdateDomainRequest.md)\n- [WorkspaceSchema](doc/WorkspaceSchema.md)\n- [WorkspaceSchemaDomainsInner](doc/WorkspaceSchemaDomainsInner.md)\n- [WorkspaceSchemaUsersInner](doc/WorkspaceSchemaUsersInner.md)\n\n## Documentation For Authorization\n\nAuthentication schemes defined for the API:\n\n### token\n\n- **Type**: HTTP Bearer Token authentication. You can create your token from the [Dub.co dashboard](https://app.dub.co/settings/tokens).\n\n## Author\n\nsupport@dub.co\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthealphamerc%2Fdub-dart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthealphamerc%2Fdub-dart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthealphamerc%2Fdub-dart/lists"}