diff --git a/.env.example b/.env.example index 1b25905..ebd0912 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,4 @@ -VITE_API_BASE_URL= +VITE_API_BASE_URL=https://api.veriflo.app VITE_DEV_PROXY_TARGET=http://localhost:3000 # Marketing site config diff --git a/src/pages/Docs.jsx b/src/pages/Docs.jsx index b09ffcc..9b12ba1 100644 --- a/src/pages/Docs.jsx +++ b/src/pages/Docs.jsx @@ -15,7 +15,7 @@ const sdkCatalog = [ type: 'Official SDK', install: 'npm install veriflo', setupLanguage: 'javascript', - setup: `import Veriflo from 'veriflo'\n\nconst client = Veriflo.init(process.env.VERTIFLO_API_KEY)\n\nconst otpRequest = await client.sendOTP('+919999999999', {\n length: 6,\n expiry: 60,\n})`, + setup: `import Veriflo from 'veriflo'\n\nconst client = Veriflo.init(process.env.VERIFLO_API_KEY)\n\nconst otpRequest = await client.sendOTP('+919999999999', {\n length: 6,\n expiry: 60,\n})`, packageUrl: 'https://www.npmjs.com/package/veriflo', packageLabel: 'npm package', downloadUrl: '/downloads/veriflo-node-starter.js', @@ -23,7 +23,7 @@ const sdkCatalog = [ notes: [ 'Best choice for Express, Next.js, NestJS, and serverless Node runtimes.', 'Includes the cleanest setup for send, verify, and resend flows.', - 'Use your API key from the dashboard as VERTIFLO_API_KEY.', + 'Use your API key from the dashboard as VERIFLO_API_KEY.', ], }, { @@ -32,7 +32,7 @@ const sdkCatalog = [ type: 'Official SDK', install: 'pip install veriflo', setupLanguage: 'python', - setup: `from veriflo import Veriflo\nimport os\n\nclient = Veriflo(api_key=os.environ['VERTIFLO_API_KEY'])\n\nresult = client.send_otp('+919999999999', length=6, expiry=60)`, + setup: `from veriflo import Veriflo\nimport os\n\nclient = Veriflo(api_key=os.environ['VERIFLO_API_KEY'])\n\nresult = client.send_otp('+919999999999', length=6, expiry=60)`, packageUrl: 'https://pypi.org/project/veriflo', packageLabel: 'PyPI package', downloadUrl: '/downloads/veriflo-python-starter.py', @@ -49,7 +49,7 @@ const sdkCatalog = [ type: 'REST Starter', install: 'No SDK required. Use built-in cURL support or your preferred HTTP client.', setupLanguage: 'php', - setup: ` '+919999999999',\n 'otpLength' => 6,\n]);`, + setup: ` '+919999999999',\n 'otpLength' => 6,\n]);`, packageUrl: 'https://api.veriflo.app/v1/otp/send', packageLabel: 'REST endpoint', downloadUrl: '/downloads/veriflo-php-starter.php', @@ -66,7 +66,7 @@ const sdkCatalog = [ type: 'REST Starter', install: 'No SDK required. Uses the Go standard library net/http package.', setupLanguage: 'go', - setup: `package main\n\nimport (\n \"bytes\"\n \"net/http\"\n \"os\"\n)\n\nfunc main() {\n apiKey := os.Getenv(\"VERTIFLO_API_KEY\")\n _ = apiKey\n}`, + setup: `package main\n\nimport (\n \"bytes\"\n \"net/http\"\n \"os\"\n)\n\nfunc main() {\n apiKey := os.Getenv(\"VERIFLO_API_KEY\")\n _ = apiKey\n}`, packageUrl: 'https://api.veriflo.app/v1/otp/send', packageLabel: 'REST endpoint', downloadUrl: '/downloads/veriflo-go-starter.go', @@ -83,7 +83,7 @@ const sdkCatalog = [ type: 'REST Starter', install: 'No SDK required. Uses Ruby standard libraries plus JSON.', setupLanguage: 'ruby', - setup: `curl -X POST https://api.veriflo.app/v1/otp/send \\\n+ -H \"Authorization: Bearer \${VERTIFLO_API_KEY}\" \\\n+ -H \"Content-Type: application/json\" \\\n+ -d '{\"phone\":\"+919999999999\",\"otpLength\":6}'`, + setup: `curl -X POST https://api.veriflo.app/v1/otp/send \\\n+ -H \"Authorization: Bearer \${VERIFLO_API_KEY}\" \\\n+ -H \"Content-Type: application/json\" \\\n+ -d '{\"phone\":\"+919999999999\",\"otpLength\":6}'`, packageUrl: 'https://api.veriflo.app/v1/otp/send', packageLabel: 'REST endpoint', downloadUrl: '/downloads/veriflo-ruby-starter.rb', @@ -100,7 +100,7 @@ const sdkCatalog = [ type: 'REST Starter', install: 'No SDK required. Uses Java HttpClient from the standard JDK.', setupLanguage: 'java', - setup: `HttpRequest request = HttpRequest.newBuilder()\n .uri(URI.create(\"https://api.veriflo.app/v1/otp/send\"))\n .header(\"Authorization\", \"Bearer \" + System.getenv(\"VERTIFLO_API_KEY\"))\n .header(\"Content-Type\", \"application/json\")\n .build();`, + setup: `HttpRequest request = HttpRequest.newBuilder()\n .uri(URI.create(\"https://api.veriflo.app/v1/otp/send\"))\n .header(\"Authorization\", \"Bearer \" + System.getenv(\"VERIFLO_API_KEY\"))\n .header(\"Content-Type\", \"application/json\")\n .build();`, packageUrl: 'https://api.veriflo.app/v1/otp/send', packageLabel: 'REST endpoint', downloadUrl: '/downloads/veriflo-java-starter.java', @@ -117,7 +117,7 @@ const sdkCatalog = [ type: 'HTTP Starter', install: 'No SDK required. Works anywhere you can issue HTTPS requests.', setupLanguage: 'bash', - setup: `curl -X POST https://api.veriflo.app/v1/otp/send \\\n+ -H \"Authorization: Bearer \${VERTIFLO_API_KEY}\" \\\n+ -H \"Content-Type: application/json\" \\\n+ -d '{\"phone\":\"+919999999999\",\"otpLength\":6}'`, + setup: `curl -X POST https://api.veriflo.app/v1/otp/send \\\n+ -H \"Authorization: Bearer \${VERIFLO_API_KEY}\" \\\n+ -H \"Content-Type: application/json\" \\\n+ -d '{\"phone\":\"+919999999999\",\"otpLength\":6}'`, packageUrl: 'https://api.veriflo.app/v1/otp/send', packageLabel: 'REST endpoint', downloadUrl: '/downloads/veriflo-curl-starter.sh', @@ -504,7 +504,7 @@ function SDKs({ activeSdk, setActiveSdk }) {
- The final WhatsApp message must stay within the max character count defined by `VERTIFLO_MESSAGE_TEMPLATE_MAX_CHARS` in your backend `.env`. + The final WhatsApp message must stay within the max character count defined by `VERIFLO_MESSAGE_TEMPLATE_MAX_CHARS` in your backend `.env`.
@@ -522,3 +522,4 @@ export default function MessageConfig() { ) } + diff --git a/src/services/api.js b/src/services/api.js index 0bd33ac..7b8c555 100644 --- a/src/services/api.js +++ b/src/services/api.js @@ -2,7 +2,7 @@ import axios from 'axios'; import { clearAuthSession, getAuthToken } from '../utils/authSession'; const configuredBaseUrl = import.meta.env.VITE_API_BASE_URL?.trim(); -const baseURL = configuredBaseUrl || '/'; +const baseURL = configuredBaseUrl || 'https://api.veriflo.app'; const api = axios.create({ baseURL,