Skip to content

Commit e1f2ee1

Browse files
feat: add vuid removal function
1 parent cc0c730 commit e1f2ee1

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/plugins/vuid_manager/index.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2022-2023, Optimizely
2+
* Copyright 2022-2024, Optimizely
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -123,6 +123,14 @@ export class VuidManager implements IVuidManager {
123123
await cache.set(this._keyForVuid, vuid);
124124
}
125125

126+
/**
127+
* Removes the VUID from the cache
128+
* @param cache Caching mechanism to use for persisting the VUID outside working memory
129+
*/
130+
async remove(cache: PersistentKeyValueCache): Promise<void> {
131+
await cache.remove(this._keyForVuid);
132+
}
133+
126134
/**
127135
* Validates the format of a Visitor Unique Identifier
128136
* @param vuid VistorId to check

0 commit comments

Comments
 (0)