Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

remove php and ruby sdk guide

Kiran K5d4986fdd2e9
diff --git a/apps/docs/quickstart/laravel.mdx b/apps/docs/quickstart/laravel.mdx
deleted file mode 100644
index 5106b272ee..0000000000
--- a/apps/docs/quickstart/laravel.mdx
+++ /dev/null
@@ -1,36 +0,0 @@
----
-title: "Laravel"
-description: "Learn how to create a short link using the Laravel and Dub PHP SDK."
----
-
-import Prerequisites from "/snippets/sdk-prerequisites.mdx";
-
-<Prerequisites />
-
-## 2. Install
-
-To install the Dub PHP SDK, run the following command:
-
-```bash Composer
-composer require dub/dub-php
-```
-
-## 3. Create link
-
-## 4. Upsert link
-
-## 5. Update link
-
-## 6. Retrieve analytics for link
-
-## 7. Examples
-
-<CardGroup cols={2}>
- <Card
- title="Laravel Example"
- icon="arrow-up-right-from-square"
- href="https://github.com/dubinc/examples"
- >
- See the full example on GitHub.
- </Card>
-</CardGroup>
diff --git a/apps/docs/quickstart/php.mdx b/apps/docs/quickstart/php.mdx
deleted file mode 100644
index f9996402d1..0000000000
--- a/apps/docs/quickstart/php.mdx
+++ /dev/null
@@ -1,149 +0,0 @@
----
-title: "Introduction"
-description: "Learn how to create a short link using the Dub PHP SDK."
----
-
-import Prerequisites from "/snippets/sdk-prerequisites.mdx";
-import LinkArguments from "/snippets/link-arguments.mdx";
-
-<Prerequisites />
-
-## 2. Install
-
-To install the Dub PHP SDK, run the following command:
-
-```bash Composer
-composer require dub/dub-php
-```
-
-Initialize the Dub PHP SDK by creating a new instance of the `Dub` class.
-
-```php
-require 'vendor/autoload.php';
-
-use \Dub;
-use Dub\Models\Components;
-use Dub\Models\Operations;
-
-$security = new Components\Security();
-$security->token = 'DUB_API_KEY';
-
-$dub = Dub\Dub::builder()
- ->setWorkspaceId('ws_clugls3...')
- ->setSecurity($security)
- ->build();
-```
-
-## 3. Create link
-
-Let's create a short link using the Dub Node.js SDK.
-
-```php index.php
-$requestBody = new Operations\CreateLinkRequestBody();
-$requestBody->url = 'https://google.com';
-
-$response = $dub->links->create($requestBody);
-
-echo $response->shortLink;
-```
-
-<Accordion title="Full list of available attributes for the Link model">
- <LinkArguments />
-</Accordion>
-
-## 3a. Create link with `externalId`
-
-Optionally, you can also pass an `externalId` field which is a unique identifier for the link in your own database to associate it with the link in Dub's system.
-
-```php index.php
-$requestBody = new Operations\CreateLinkRequestBody();
-$requestBody->url = 'https://google.com';
-$requestBody->externalId = '12345';
-
-$response = $dub->links->create($requestBody);
-
-echo $response->shortLink;
-```
-
-## 4. Upsert link
-
-Dub Node.js SDK provides a method to create or update a link so you don't have to worry about checking if the link already exists.
-
-```php index.php
-// Update the link if same URL already exists or create a new link
-$requestBody = new Operations\UpsertLinkRequestBody();
-$requestBody->url = 'https://google.com';
-
-$response = $dub->links->upsert($requestBody);
-
-echo $response->shortLink;
-```
-
-## 5. Update link
-
-Let's update an existing link using the Dub Node.js SDK.
-
-You can do that in two ways:
-
-- Using the link's `linkId` in Dub's system.
-- Using the link's `externalId` in your own database (prefixed with `ext_`).
-
-```php index.php
-// Update a link by its linkId
-$requestBody = new Operations\UpdateLinkRequest();
-$requestBody->linkId = 'clv3o9p9q000au1h0mc7r6l63'
-$requestBody->url = 'https://google.uk'; // new URL
-
-$response = $dub->links->update($requestBody);
-
-// Update a link by its externalId
-$requestBody = new Operations\UpdateLinkRequest();
-$requestBody->externalId = 'ext_12345'
-$requestBody->url = 'https://google.uk'; // new URL
-
-$response = $dub->links->update($requestBody);
-
-echo $response->shortLink;
-```
-
-## 6. Retrieve analytics for link
-
-Dub allows you to retrieve analytics for a link using the Dub Node.js SDK.
-
-```php index.php
-// Retrieve the timeseries analytics for the last 7 days for a link
-$request = new Operations\RetrieveAnalyticsRequest();
-$request->linkId = 'clv3o9p9q000au1h0mc7r6l63';
-$request->interval = Operations\Interval::Ninetyd;
-$request->groupBy = Operations\GroupBy::Timeseries;
-
-$response = $dub->analytics->retrieve($request);
-
-echo $response;
-```
-
-Simliarly, you can retrieve analytics for a link using the `externalId` field.
-
-```php index.php
-// Retrieve the timeseries analytics for the last 7 days for a link
-$request = new Operations\RetrieveAnalyticsRequest();
-$request->externalId = 'ext_12345';
-$request->interval = Operations\Interval::Ninetyd;
-$request->groupBy = Operations\GroupBy::Timeseries;
-
-$response = $dub->analytics->retrieve($request);
-
-echo $response;
-```
-
-## 7. Examples
-
-<CardGroup cols={2}>
- <Card
- title="Express Example"
- icon="arrow-up-right-from-square"
- href="https://github.com/dubinc/examples/tree/main/php"
- >
- See the full example on GitHub.
- </Card>
-</CardGroup>
diff --git a/apps/docs/quickstart/rails.mdx b/apps/docs/quickstart/rails.mdx
deleted file mode 100644
index 95c5300df8..0000000000
--- a/apps/docs/quickstart/rails.mdx
+++ /dev/null
@@ -1,36 +0,0 @@
----
-title: "Ruby on Rails"
-description: "Learn how to create a short link using the Rails and Dub Ruby SDK."
----
-
-import Prerequisites from "/snippets/sdk-prerequisites.mdx";
-
-<Prerequisites />
-
-## 2. Install
-
-To install the Dub Ruby SDK, run the following command:
-
-```bash RubyGems
-gem install dub
-```
-
-## 3. Create link
-
-## 4. Upsert link
-
-## 5. Update link
-
-## 6. Retrieve analytics for link
-
-## 7. Examples
-
-<CardGroup cols={2}>
- <Card
- title="Rails Example"
- icon="arrow-up-right-from-square"
- href="https://github.com/dubinc/examples"
- >
- See the full example on GitHub.
- </Card>
-</CardGroup>
diff --git a/apps/docs/quickstart/ruby.mdx b/apps/docs/quickstart/ruby.mdx
deleted file mode 100644
index 44585ba95f..0000000000
--- a/apps/docs/quickstart/ruby.mdx
+++ /dev/null
@@ -1,77 +0,0 @@
----
-title: "Introduction"
-description: "Learn how to create a short link using the Dub Ruby SDK."
----
-
-import Prerequisites from "/snippets/sdk-prerequisites.mdx";
-import LinkArguments from "/snippets/link-arguments.mdx";
-
-<Prerequisites />
-
-## 2. Install
-
-To install the Dub Ruby SDK, run the following command:
-
-```bash RubyGems
-gem install dub
-```
-
-Initialize the Dub Ruby SDK by creating a new instance of the `Dub` class.
-
-```ruby
-require 'dub'
-
-d = ::OpenApiSDK::Dub.new(
- workspace_id: "ws_clugls3...",
-)
-
-d.config_security(
- ::OpenApiSDK::Shared::Security.new(
- token: "DUB_API_KEY",
- )
-)
-```
-
-## 3. Create link
-
-Let's create a short link using the Dub Node.js SDK.
-
-```ruby index.rb
-res = d.links.create(workspace_id="<value>", project_slug="<value>", request_body=::OpenApiSDK::Operations::CreateLinkRequestBody.new(
- url: "https://google/com",
- external_id: "123456",
- tag_ids: [
- "<value>",
- ],
- ))
-```
-
-<Accordion title="Full list of available attributes for the Link model">
- <LinkArguments />
-</Accordion>
-
-## 3a. Create link with `externalId`
-
-Optionally, you can also pass an `externalId` field which is a unique identifier for the link in your own database to associate it with the link in Dub's system.
-
-```ruby index.rb
-
-```
-
-## 4. Upsert link
-
-## 5. Update link
-
-## 6. Retrieve analytics for link
-
-## 7. Examples
-
-<CardGroup cols={2}>
- <Card
- title="Ruby Example"
- icon="arrow-up-right-from-square"
- href="https://github.com/dubinc/examples"
- >
- See the full example on GitHub.
- </Card>
-</CardGroup>
diff --git a/apps/docs/quickstart/sinatra.mdx b/apps/docs/quickstart/sinatra.mdx
deleted file mode 100644
index 1278c4e77a..0000000000
--- a/apps/docs/quickstart/sinatra.mdx
+++ /dev/null
@@ -1,36 +0,0 @@
----
-title: "Sinatra"
-description: "Learn how to create a short link using the Sinatra and Dub Ruby SDK."
----
-
-import Prerequisites from "/snippets/sdk-prerequisites.mdx";
-
-<Prerequisites />
-
-## 2. Install
-
-To install the Dub Ruby SDK, run the following command:
-
-```bash RubyGems
-gem install dub
-```
-
-## 3. Create link
-
-## 4. Upsert link
-
-## 5. Update link
-
-## 6. Retrieve analytics for link
-
-## 7. Examples
-
-<CardGroup cols={2}>
- <Card
- title="Sinatra Example"
- icon="arrow-up-right-from-square"
- href="https://github.com/dubinc/examples"
- >
- See the full example on GitHub.
- </Card>
-</CardGroup>