- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2025 12:45 AM - edited 05-20-2025 12:48 AM
hi all,
I want to use GlideSecureRandomUtil api in my fluent app, but i can't import its type from the module, i found
//case 1: not type defination, record script include can invoke this api
import { GlideSecureRandomUtil } from '@servicenow/glide';
GlideSecureRandomUtil.getSecureRandomString()
//case 2: has type defination,but record script include can't invoke, and show error SecureRandomUtil is undefined
import { SecureRandomUtil} from '@servicenow/glide';
SecureRandomUtil.getSecureRandomString()
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2025 02:08 PM
@jusfory Thanks for the feedback, we are actually in the process of fixing up the `@servicenow/glide` package so the next version will have this fixed. The `SecureRandomUtil` is actually the `GlideSecureRandomUtil` just named improperly.
You can manually add a `servicenow-glide.d.ts` file to your project and add this patch for now to get past this
declare module "@servicenow/glide" {
export class GlideSecureRandomUtil {
static getSecureRandomInt(): number
static getSecureRandomIntBound(bound: number): number
static getSecureRandomLong(): number
static getSecureRandomString(length: number): string
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2025 02:08 PM
@jusfory Thanks for the feedback, we are actually in the process of fixing up the `@servicenow/glide` package so the next version will have this fixed. The `SecureRandomUtil` is actually the `GlideSecureRandomUtil` just named improperly.
You can manually add a `servicenow-glide.d.ts` file to your project and add this patch for now to get past this
declare module "@servicenow/glide" {
export class GlideSecureRandomUtil {
static getSecureRandomInt(): number
static getSecureRandomIntBound(bound: number): number
static getSecureRandomLong(): number
static getSecureRandomString(length: number): string
}
}