> For the complete documentation index, see [llms.txt](https://cross-packages.gitbook.io/cross-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cross-packages.gitbook.io/cross-api/providers.md).

# Providers

Providers are implementations of services that assist in the business rules of your project. They can contain one or more implementations, you decide which one to use, to switch the key in .env.

To use a provider in your business logic, simply inject your token with tsyinge:

```typescript
import { IProvider } from '@shared/container/providers/Provider/models/IProvider';
import { injectable, inject } from 'tsyringe';

@injectable()
export class ExampleService {
  public constructor(
    @inject('Provider')
    private readonly provider: IProvider,
  ) {}

  public async execute(): Promise<void> {
    try {
      this.provider.doSomething();
    } catch (error: unknown) {
      throw error;
    }
  }
}
```
