Dynamics integration module for Edirect applications. Provides services and utilities to interact with Microsoft Dynamics APIs, including authentication, data posting, and configuration.
npm install @edirect/dynamicsDynamics integration module for Edirect applications. Provides services and utilities to interact with Microsoft Dynamics APIs, including authentication, data posting, and configuration.
- Handles OAuth2 authentication with Dynamics
- Provides service for posting and retrieving data
- Integrates with NestJS and Edirect config modules
``bash`
npm install @edirect/dynamics
Add the following environment variables to your .env file:
`env`
DYNAMICS_TOKEN_URL="https://login.windows.net/YOUR_TENANT/oauth2/token"
DYNAMICS_CLIENT_ID="YOUR_CLIENT_ID"
DYNAMICS_USER_NAME="YOUR_USER_NAME"
DYNAMICS_PASSWORD="YOUR_DYNAMICS_PASSWORD"
DYNAMICS_RESOURCE="YOUR_RESOURCE_URL"
DYNAMICS_ENABLED="true/false"
Import and register the module in your app:
`typescript
import { Module } from '@nestjs/common';
import { DynamicsModule } from '@edirect/dynamics';
@Module({
imports: [DynamicsModule],
...
})
export class AppModule {}
`
Use the service in your controllers:
`typescript
import { Controller } from '@nestjs/common';
import { DynamicsService } from '@edirect/dynamics';
@Controller('cats')
export class CatsController {
constructor(private readonly dynamicsService: DynamicsService) {}
postSomethingToDynamics(): Promise
return this.dynamicsService.post('YOUR_URL', {
YOUR_ATTRIBUTE: 'YOUR_VALUE',
});
}
}
`
- DYNAMICS_TOKEN_URL: OAuth2 token endpoint for DynamicsDYNAMICS_CLIENT_ID
- : Client ID for authenticationDYNAMICS_USER_NAME
- : Username for DynamicsDYNAMICS_PASSWORD
- : Password for DynamicsDYNAMICS_RESOURCE
- : Resource URL for Dynamics APIDYNAMICS_ENABLED`: Enable/disable Dynamics integration
-