Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
patchoulish committed Nov 7, 2024
1 parent a46d15d commit 49982af
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,22 @@ Install the library via [NuGet](https://www.nuget.org/packages/firecrawl-dotnet)
dotnet add package firecrawl-dotnet
```

### Extensions
Install optional library extensions for more functionality, depending on your use case.
#### Dependency Injection
Integrate firecrawl-dotnet and your DI container of choice. Install the extension library via [NuGet](https://www.nuget.org/packages/firecrawl-dotnet-dependencyinjection):
```bash
dotnet add package firecrawl-dotnet-dependencyinjection
```


## Usage
1. Obtain an API key from the [Firecrawl Dashboard](https://www.firecrawl.dev/app) (requires a Firecrawl account).
2. Pass the API key into a new instance of the `FirecrawlService` class or use a configured `HttpClient` if advanced configuration (e.g., proxies) is required.
3. Use the methods available on `FirecrawlService` to interact with the Firecrawl API.

### Initialization
The library can be initialized in two ways:
The library can be initialized in three ways:
#### Basic Initialization
Pass in your API key directly:
```csharp
Expand All @@ -35,6 +43,28 @@ httpClient.DefaultRequestHeaders.Authorization =

var firecrawl = new FirecrawlService(httpClient);
```
#### Dependency Injection
If you've installed the appropriate extension library.
1. Register `FirecrawlService` with your dependency container:
```csharp
services.AddFirecrawlHttpClient(options =>
{
options.BaseUrl = new Uri("https://api.firecrawl.dev/v1/");
options.ApiKey = "YOUR_FIRECRAWL_API_KEY";
});
```
2. Inject `IFirecrawlService` where needed:
```csharp
public class MyClass
{
private readonly IFirecrawlService firecrawl;

public MyClass(IFirecrawlService firecrawl)
{
this.firecrawl = firecrawl;
}
}
```


## Documentation
Expand Down

0 comments on commit 49982af

Please sign in to comment.