> ## Documentation Index
> Fetch the complete documentation index at: https://doc.eazemyapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Frontend integration

All API requests to EazeMyAPI must include the **API signature key** in the request header.

This key verifies that the request is authorized to access your project’s APIs.

***

## Required Header

Every API request must include the following header:

```
X-API-SIGNATURE: <secret-key>
```

***

### JavaScript (Axios)

```javascript theme={null}
import axios from "axios";

axios.get("https://api.eazemyapi.com/demo-project/users/v1/list", {
  headers: {
    "X-API-SIGNATURE": "your-secret-key"
  }
})
.then(res => console.log(res.data));
```

***

### PHP (cURL)

```php theme={null}
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://api.eazemyapi.com/demo-project/users/v1/list");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "X-API-SIGNATURE: your-secret-key"
]);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
```

***

### Python (requests)

```python theme={null}
import requests

url = "https://api.eazemyapi.com/demo-project/users/v1/list"
headers = {
    "X-API-SIGNATURE": "your-secret-key"
}

response = requests.get(url, headers=headers)
print(response.json())
```

***

### cURL

```bash theme={null}
curl https://api.eazemyapi.com/demo-project/users/v1/list \
  -H "X-API-SIGNATURE: your-secret-key"
```

***

## API Key Scopes (Future Vision) (Future Vision)

In the future, EazeMyAPI will support **scoped API keys** to enhance security and control.

### Planned Capabilities

* **Read-only keys** (GET requests only)
* **Write keys** (POST, PUT, DELETE access)
* **Admin keys** (full access)
* **Table-level restrictions** (limit access to specific data)
* **Rate-limited keys** (control usage per key)

### Example (Future Format)

```json theme={null}
{
  "key": "abc123",
  "scopes": ["read:users", "write:posts"],
  "rate_limit": "1000/hour"
}
```

This will allow developers to safely use API keys in different environments (frontend, backend, third-party integrations).

***

## Security Best Practices

* Never expose the secret key in public repositories
* Do not store the key inside frontend code
* Use environment variables to store API keys
* Rotate keys if compromised

***

## Important Note

The API signature key provides full access to your project APIs.

Anyone with this key can perform API operations. Handle it securely.

If your application requires user-level security, implement authentication and access control separately.

***

## Framework Examples

### React

```javascript theme={null}
import React, { useEffect } from "react";

function App() {
  useEffect(() => {
    fetch("https://api.eazemyapi.com/demo-project/users/v1/list", {
      headers: {
        "X-API-SIGNATURE": "your-secret-key"
      }
    })
    .then(res => res.json())
    .then(data => console.log(data));
  }, []);

  return <div>Check console</div>;
}

export default App;
```

***

### Next.js

```javascript theme={null}
export async function getServerSideProps() {
  const res = await fetch("https://api.eazemyapi.com/demo-project/users/v1/list", {
    headers: {
      "X-API-SIGNATURE": "your-secret-key"
    }
  });

  const data = await res.json();

  return { props: { data } };
}
```

***

### Vue.js

```javascript theme={null}
export default {
  mounted() {
    fetch("https://api.eazemyapi.com/demo-project/users/v1/list", {
      headers: {
        "X-API-SIGNATURE": "your-secret-key"
      }
    })
    .then(res => res.json())
    .then(data => console.log(data));
  }
};
```

***

### Angular

```typescript theme={null}
import { HttpClient, HttpHeaders } from '@angular/common/http';

constructor(private http: HttpClient) {}

ngOnInit() {
  const headers = new HttpHeaders({
    'X-API-SIGNATURE': 'your-secret-key'
  });

  this.http.get('https://api.eazemyapi.com/demo-project/users/v1/list', { headers })
    .subscribe(res => console.log(res));
}
```

***

### Flutter (Dart)

```dart theme={null}
import 'package:http/http.dart' as http;

void fetchData() async {
  var response = await http.get(
    Uri.parse('https://api.eazemyapi.com/demo-project/users/v1/list'),
    headers: {
      'X-API-SIGNATURE': 'your-secret-key'
    },
  );

  print(response.body);
}
```

***

### Android (Kotlin)

```kotlin theme={null}
val client = OkHttpClient()

val request = Request.Builder()
    .url("https://api.eazemyapi.com/demo-project/users/v1/list")
    .addHeader("X-API-SIGNATURE", "your-secret-key")
    .build()

val response = client.newCall(request).execute()
println(response.body?.string())
```

***

### iOS (Swift)

```swift theme={null}
import Foundation

var request = URLRequest(url: URL(string: "https://api.eazemyapi.com/demo-project/users/v1/list")!)
request.addValue("your-secret-key", forHTTPHeaderField: "X-API-SIGNATURE")

let task = URLSession.shared.dataTask(with: request) { data, response, error in
    if let data = data {
        print(String(data: data, encoding: .utf8)!)
    }
}

task.resume()
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.